diff options
author | Lorin Hochstein <lorin@isi.edu> | 2011-11-02 10:50:54 -0400 |
---|---|---|
committer | Lorin Hochstein <lorin@isi.edu> | 2011-11-02 10:53:14 -0400 |
commit | 743b36dcac7e4dd8b914d78c0ab11764f415039c (patch) | |
tree | 16343cc41603381443a1906688a7b4e4fec0f722 | |
parent | d3e0cfcc7f7bc24b4bd551f5b5c0c952f2fd2f3f (diff) | |
download | nova-743b36dcac7e4dd8b914d78c0ab11764f415039c.tar.gz nova-743b36dcac7e4dd8b914d78c0ab11764f415039c.tar.xz nova-743b36dcac7e4dd8b914d78c0ab11764f415039c.zip |
Updated rst docs to include threading model.
Change-Id: Id12cd6584dfd22fe32097cfddf0247c0cc115ac0
-rw-r--r-- | doc/source/devref/index.rst | 1 | ||||
-rw-r--r-- | doc/source/devref/threading.rst | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/doc/source/devref/index.rst b/doc/source/devref/index.rst index 859d4e331..7b12f72a6 100644 --- a/doc/source/devref/index.rst +++ b/doc/source/devref/index.rst @@ -35,6 +35,7 @@ Background Concepts for Nova .. toctree:: :maxdepth: 3 + threading distributed_scheduler multinic zone diff --git a/doc/source/devref/threading.rst b/doc/source/devref/threading.rst new file mode 100644 index 000000000..e499f47e1 --- /dev/null +++ b/doc/source/devref/threading.rst @@ -0,0 +1,17 @@ +Threading model +=============== + +All OpenStack services use *green thread* model of threading, implemented +through using the Python `eventlet <http://eventlet.net/>`_ and +`greenlet <http://packages.python.org/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. + + |