From 9885787db17956c0fdea7c5d363f90b90398255f Mon Sep 17 00:00:00 2001 From: "ChangBo Guo(gcb)" Date: Thu, 5 Nov 2015 16:57:47 +0800 Subject: [PATCH] doc: update threading.rst There are two ways to give other greenthread chance to run: greenthread.sleep(0) or time.sleep(0). Add the second way in threading.rst and recommend the second way for contributors. Change-Id: I33dc73a0edfa5fde0e5fa8051a594874ab166970 --- doc/source/threading.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/source/threading.rst b/doc/source/threading.rst index f1ab0cc06d61..a5fcbd88f391 100644 --- a/doc/source/threading.rst +++ b/doc/source/threading.rst @@ -31,7 +31,9 @@ delays in the case that there is only a single green thread:: from eventlet import greenthread ... greenthread.sleep(0) - +In current code, time.sleep(0)does the same thing as greenthread.sleep(0) if +time module is patched through eventlet.monkey_patch(). To be explicit, we recommend +contributors use ``greenthread.sleep()`` instead of ``time.sleep()``. MySQL access and eventlet -------------------------