Skip to content

Instantly share code, notes, and snippets.

@erikfrey
Created March 21, 2011 03:01
Show Gist options
  • Save erikfrey/878950 to your computer and use it in GitHub Desktop.
Save erikfrey/878950 to your computer and use it in GitHub Desktop.
child_runner is spawned 2^SPAWN_COUNT times
import gevent
import gevent.pool
import multiprocessing
SPAWN_COUNT = 5
def child_runner():
p = multiprocessing.Process(target=child)
p.start()
print gevent.getcurrent()
def child():
gevent.sleep(1)
if __name__ == "__main__":
p = gevent.pool.Pool(size=16)
for i in xrange(SPAWN_COUNT):
p.spawn(child_runner)
p.join()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment