Files
nova/doc/source/devref/threading.rst
Lorin Hochstein 743b36dcac Updated rst docs to include threading model.
Change-Id: Id12cd6584dfd22fe32097cfddf0247c0cc115ac0
2011-11-02 10:53:14 -04:00

720 B

Threading model

All OpenStack services use green thread model of threading, implemented through using the Python eventlet and greenlet libraries.

Green threads use a cooperative model of threading: thread context switches can only occur when specific eventlet or greenlet library calls are made (e.g., sleep, certain I/O calls). From the operating system's point of view, each OpenStack service runs in a single thread.

The use of green threads reduces the likelihood of race conditions, but does not completely eliminate them. In some cases, you may need to use the @utils.synchronized(...) decorator to avoid races.