Settings

Theme

Understanding gunicorn's async worker concurrency model

words.volant.is

1 points by motter 12 years ago · 2 comments

Reader

amirouche 12 years ago

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.

  • amirouche 12 years ago

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

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection