What is a coroutine?

Coroutines and concurrency are largely orthogonal. Coroutines are a general control structure whereby flow control is cooperatively passed between two different routines without returning. The ‘yield’ statement in Python is a good example. It creates a coroutine. When the ‘yield ‘ is encountered the current state of the function is saved and control is returned … Read more

What’s the difference between the message passing and shared memory concurrency models?

It’s a pretty simple difference. In a shared memory model, multiple workers all operate on the same data. This opens up a lot of the concurrency issues that are common in parallel programming. Message passing systems make workers communicate through a messaging system. Messages keep everyone seperated, so that workers cannot modify each other’s data. … Read more