using gevent/1.0b2, greenlet/0.3.4
import os
from gevent.hub import fork, get_hub
print 'parent_pid=%d, hub=%s' % (os.getpid(), get_hub())
pid = fork()
if not pid:
# child
print 'child_pid=%d, hub=%s' % (os.getpid(), get_hub())
os._exit(0)
print 'parent_pid=%d, hub=%s' % (os.getpid(), get_hub())
PRINTS:
parent_pid=19326, hub=<Hub at 0x19d92eb0 epoll default pending=0 ref=0
fileno=3>
child_pid=19327, hub=<Hub at 0x19d92eb0 epoll default pending=0 ref=0
fileno=3>
parent_pid=19326, hub=<Hub at 0x19d92eb0 epoll default pending=0 ref=0
fileno=3>
If hub is said to be thread local, should subprocess have its own hub
or not?
Thanks!