- To implement CSP, coroutines should communicate exclusively via channels (queue).
- Queue should support interprocess communication.
- Since coroutines do not share memory anymore (except of channels), they can be executed in separate python processes.
- It will enable real parallelism since there will be separate GIL in each python process.
- Ideally there should be same number of parallel loops running as the number of CPU cores 1.
- Distributed scheduler should be implemented to coordinate
- The ability to execute clones of a single coroutine should be present (e.g. if the input queue is growing faster then coroutine reads from it).
- One loop should be "master-loop" that marks coroutines to be executed on specific loop.
- For the sake of simplicity, initially just round-robin schedule policy should be implemented.
- Fast IPC for loops synchronization is required.
1 There's possibility to implement multi-node parallelism (as in Erlang)
- C.A.R. Hoare - Communicating Sequential Processes. Paper.
- python-csp: implementation of CSP on threads/processes. Code, presentation.
- PyCSP: paper.
- aioprocessing - https://github.com/dano/aioprocessing