Concurrency in Python: CSP and Coroutines

Concurrency in Python: CSP and Coroutines

Both of these concurrency models leverage message passing, but whereas actors pass messages between containers of state, the CSP model passes messages between channels, a form of synchronization and communication between coroutines or coroutine-like processes. You may not want to use CSP if:

The most popular example of CSP in a programming language at the moment is , whose concurrency model is designed around a derivative of Hoare’s CSP process calculus and implements channels as first-class citizens. However, a number of small academic projects have provided a base layer from which a CSP framework could arise:

Unlike other concurrency models, which suffer from a lack of Pythonic foundations, implementing a CSP process calculus could be done pythonically through the use of Python’s native and various coroutines and coroutine libraries.

Source: bytes.yingw787.com