Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Should gevent's fork create a new hub in its forked process?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Liming Zhao  
View profile  
 More options May 11 2012, 1:16 pm
From: Liming Zhao <limingz...@gmail.com>
Date: Fri, 11 May 2012 10:16:16 -0700 (PDT)
Local: Fri, May 11 2012 1:16 pm
Subject: Should gevent's fork create a new hub in its forked process?
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!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Damjan  
View profile  
 More options May 11 2012, 2:07 pm
From: Damjan <gdam...@gmail.com>
Date: Fri, 11 May 2012 11:07:16 -0700 (PDT)
Local: Fri, May 11 2012 2:07 pm
Subject: Should gevent's fork create a new hub in its forked process?

Well, fork creates processes not threads. So the object could have the same id, but still exists in separate kemory spaces.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »