Hacker News new | ask | show | jobs
by oddurmagg 4664 days ago
Stackless Python support Go style concurrency with tasklets( goroutines in go) and channels for scheduling and data passing between them.

Pypy now has stackless support, which makes it the obvious candidate for doing CSP style concurrency with python.

It will not however, scale that concurrency to execute in parallel in multiple cores, since it is still bound by the GIL.

If you want to stay with CPython, you could look at Gevent.

1 comments

gevent is based on an eventloop to do the scheduling, it's quite different than the scheduling done in offset and offset will soon support the possibility to launch your goroutin on different OS processes for //. More over gevent monkey-patch the standard library which make sometimes the integration with your code difficult, offset however use its own syscall module.

Also the implementation of channels or stackless in pypy is a little different than the one you can find in offset (or go for that matter). offset channels support buffering, and you can also select them. offset like the implementation of stackless in pypy is using the continulets to do the job when you are using in pypy and python-fibers on cpython which bind the stacklet lib from pypy as well.