On 2015-06-21 19:48, anu sree wrote:
Thanks noufal,

I got it.

After gevent.spawn, we have to do join or gevent.joinall or gevent.sleep or
patched library call to start the greenlets, right ?

join (and joinall) will pause the current greenlet till the ones you've joined terminate (similar to the threading.Thread join method).

gevent.sleep will suspend the execution of the current greenlet and let other greenlets get some time to execute.

I have see the code which not using any of these after gevent.spawn, How it
is working there ?
https://github.com/Juniper/contrail-controller/blob/master/src/opserver/uveserver.py#L656

Neither of these are *necessary*. Just creating a greenlet and `.start`ing it will make it run similar to a thread as long as other greenlets don't hog the CPU and have some calls that can context switch.


_______________________________________________
BangPypers mailing list
BangPypers@python.org
https://mail.python.org/mailman/listinfo/bangpypers

Reply via email to