Primary reason for doing concurrency is to implement parallelism to speed up the process
Because of the communication and syncronization steps, usually there is no independent concurrency.
i.e. all threads start at once, then end at once.
_Task T{ // thread type
void main(){...} // thread starts here
};
int main(){
{ // COBEGIN In the destructor of T
T t; // the main thread checks if t is still running
} // COEND and if it is, it waits in the destructor
// can be also written like this :/
T *t = new T; // create thread object on heap, start thread
delete t; // waits for thread to finish
}
based on message passing.