Hacker News new | past | comments | ask | show | jobs | submit login
Understanding gunicorn's async worker concurrency model (volant.is)
1 point by motter on April 22, 2014 | hide | past | favorite | 2 comments



An event loop is a cooperative scheduler. In a cooperative scheduler, contrary to a the linux kernel scheduler, the current running code decides when to "sleep" to allow another code to execute, so at any point in time only one code is running just like on a single core CPU. The turnmoil about parallelism and concurrency makes it look like the event loop may not have the same issues as a code based on POSIX threads, kind of True, still, only one code is running at any point in time, it's not possible to read broken values, still you need to manage states correctly possibly requiring the use of non-POSIX locks because before an asynchronous callback is called, states might have changed.


in a web context, shared states are considered bad pratice, so you should notice the above.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: