Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's a "control block"

Tags:

c++

boost

While reading the boost::coroutine documentation, I came accross the term control block :

The solution is that each coroutine has its own stack and control-block

While the notion of a stack is fairlly familiar, I've never encountered the term control block before. The following image may have provided some contextual (no pun intended) understanding of what a control block is

source: boost documentation

Since I can't google my way to a better explanation (the provided link to boost context only made things more obscure), could anyone provide a solid definition and explain the workings of a control block?

thanks

like image 592
Lorah Attkins Avatar asked Apr 30 '26 17:04

Lorah Attkins


1 Answers

The term dates back to the Process Control Block from IIRC CP/M, at least 4 decades. It's the block of data which describes a running context. Later on, threads got Thread Control Blocks Here the need for state meant a similar data structure, so the name Control Block makes sense. The only oddity is that usually these Control Blocks are OS structures, but boost coroutines aren't OS managed.

like image 83
MSalters Avatar answered May 02 '26 06:05

MSalters