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
the trunk now has gevent.subprocess module
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
  5 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
 
Denis Bilenko  
View profile  
 More options May 2 2012, 7:13 am
From: Denis Bilenko <denis.bile...@gmail.com>
Date: Wed, 2 May 2012 15:13:05 +0400
Local: Wed, May 2 2012 7:13 am
Subject: the trunk now has gevent.subprocess module
The interface is the same as stdlib's subprocess on Python 2.7.2. It
works on Windows.

Please test it and post your feedback there.


 
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.
François-Xavier Bourlet  
View profile  
 More options May 2 2012, 3:25 pm
From: François-Xavier Bourlet <bomb...@gmail.com>
Date: Wed, 2 May 2012 12:25:31 -0700
Local: Wed, May 2 2012 3:25 pm
Subject: Re: [gevent] the trunk now has gevent.subprocess module
Hey Denis,

Is it gevent < 1.0 compatible? Is there is anyway to expect the
gevent.subprocess backported to gevent < 1.0?

I actually maintain the package "gevent_subprocess" on pipy, but it
has never be tested on windows, either run against official python
subprocess tests (there is few tests unit test coming with it though).
So I would love to have subprocess in the stable version of gevent.

A little implementation detail question: it is waiting after a process
by catching the SIGCHL signal?

With gevent 0.13.7, when starting a lots of process, if they all
terminate at the same time, you easily miss half of the SIGCHLD (you
simply don't get them). So I did something... you know... polling
(shame on me).
Following the fact that UNIX signals are not reliable by design, this
problem is expected.

Is libev does something special about that? (threads for waitpid?)

Thanks for gevent,

Regards,
fx

On Wed, May 2, 2012 at 4:13 AM, Denis Bilenko <denis.bile...@gmail.com> wrote:
> The interface is the same as stdlib's subprocess on Python 2.7.2. It
> works on Windows.

> Please test it and post your feedback there.

--
François-Xavier Bourlet

 
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.
Denis Bilenko  
View profile  
 More options May 2 2012, 4:16 pm
From: Denis Bilenko <denis.bile...@gmail.com>
Date: Thu, 3 May 2012 00:16:32 +0400
Local: Wed, May 2 2012 4:16 pm
Subject: Re: [gevent] the trunk now has gevent.subprocess module
On Wed, May 2, 2012 at 11:25 PM, François-Xavier Bourlet

<bomb...@gmail.com> wrote:
> Hey Denis,

> Is it gevent < 1.0 compatible?

No.

> Is there is anyway to expect the gevent.subprocess backported to gevent < 1.0?

No, because on POSIX it uses libev's child watchers and on Windows it
uses a threadpool. Neither is present in gevent 0.13, so backporting
would be very very hard.

> I actually maintain the package "gevent_subprocess" on pipy, but it
> has never be tested on windows, either run against official python
> subprocess tests (there is few tests unit test coming with it though).
> So I would love to have subprocess in the stable version of gevent.

Well, 1.0 is bound to become stable at some point :)
Is there anything that stops you from using 1.0beta now?

> A little implementation detail question: it is waiting after a process
> by catching the SIGCHL signal?

yes, that's what libev does.

> With gevent 0.13.7, when starting a lots of process, if they all
> terminate at the same time, you easily miss half of the SIGCHLD (you
> simply don't get them). So I did something... you know... polling
> (shame on me).
> Following the fact that UNIX signals are not reliable by design, this
> problem is expected.

> Is libev does something special about that? (threads for waitpid?)

What libev does is it calls non-blocking waitpid(ANY) in a loop until
there no more dead children left.
https://bitbucket.org/denis/gevent/src/f838056c793d/libev/ev.c#cl-2010
Thus multiple SIGCHLDs merging into one is not a problem.

Cheers,
Denis.


 
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.
François-Xavier Bourlet  
View profile  
 More options May 2 2012, 6:07 pm
From: François-Xavier Bourlet <bomb...@gmail.com>
Date: Wed, 2 May 2012 15:07:07 -0700
Local: Wed, May 2 2012 6:07 pm
Subject: Re: [gevent] the trunk now has gevent.subprocess module
Thanks for the detailed response.

> Well, 1.0 is bound to become stable at some point :)
> Is there anything that stops you from using 1.0beta now?

For some lazy reasons, we are going to wait and use my
gevent_subprocess for now. But as soon as we can switch we will.

Thanks for the code link, I should have think about it :)

Regards,
--
François-Xavier Bourlet


 
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.
Denis Bilenko  
View profile  
 More options Sep 6 2012, 9:48 am
From: Denis Bilenko <denis.bile...@gmail.com>
Date: Thu, 6 Sep 2012 17:48:29 +0400
Local: Thurs, Sep 6 2012 9:48 am
Subject: Re: [gevent] Re: the trunk now has gevent.subprocess module

On Tue, Sep 4, 2012 at 9:50 PM, Dan Sully <dsu...@gmail.com> wrote:
> Calling:

> subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

> Results in a: TypeError: child watchers are only available on the default
> loop

> The subprocess.Popen call is run in a greenlet that's spawned by a patched
> gevent.threadpool.ThreadPool()

How do you use thread pool ? If you use any gevent API there (directly
or through monkey patching), an event loop would be created for each
thread. Due to libev limitations only the original event loop can work
with child watchers, hence the exception.

 
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 »