[issue12040] Expose a Process.sentinel property (and fix polling loop in Process.join())

2011-06-06 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12040] Expose a Process.sentinel property (and fix polling loop in Process.join())

2011-06-06 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 568a3ba088e4 by Antoine Pitrou in branch 'default':
Issue #12040: Expose a new attribute `sentinel` on instances of
http://hg.python.org/cpython/rev/568a3ba088e4

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12040] Expose a Process.sentinel property (and fix polling loop in Process.join())

2011-05-16 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Just a detail, but with the last version, select is retried with the
> full timeout (note that the signal you're the most likely to receive
> is SIGCHLD and since it's ignored by default it won't cause EINTR, so
> this shouldn't happen too often).

Indeed, it is. In practice we don't see anyone complaining about EINTR
issues, so I guess it's quite rare anyway.

> By the way, it's not the first time EINTR-issues pop up: would it be
> possible/worth it/interesting to expose this kind of wrapper somewhere
> (even as a private API), or a context manager ?

Yes, but where?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12040] Expose a Process.sentinel property (and fix polling loop in Process.join())

2011-05-13 Thread Charles-François Natali

Charles-François Natali  added the comment:

Just a detail, but with the last version, select is retried with the full 
timeout (note that the signal you're the most likely to receive is SIGCHLD and 
since it's ignored by default it won't cause EINTR, so this shouldn't happen 
too often).
By the way, it's not the first time EINTR-issues pop up: would it be 
possible/worth it/interesting to expose this kind of wrapper somewhere (even as 
a private API), or a context manager ?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12040] Expose a Process.sentinel property (and fix polling loop in Process.join())

2011-05-13 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

That looks better. :)

btw, that eintr_retry utility probably deserves to be in a more
prominent place in the stdlib but I don't have a good suggestion as to
where at the moment.  I believe similar code exists in many places in
the code base.

If it is not going to be documented as an official
multiprocessing.util function, rename it to _eintr_retry().  that way
it'll be easier to move to a new place in the library if/when we do
want to make it public.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12040] Expose a Process.sentinel property (and fix polling loop in Process.join())

2011-05-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a new patch addressing Gregory's comment (retry select() on EINTR).

--
Added file: http://bugs.python.org/file21983/process_sentinel2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12040] Expose a Process.sentinel property (and fix polling loop in Process.join())

2011-05-09 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12040] Expose a Process.sentinel property (and fix polling loop in Process.join())

2011-05-09 Thread Antoine Pitrou

New submission from Antoine Pitrou :

This patch exposes a new read-only property of multiprocessing.Process objects, 
named "sentinel".
As the doc indicates, this is a file descriptor undex Unix, and a handle under 
Windows. Both are suitable for flexible polling/waiting with the appropriate OS 
primitives. They become ready when the process has ended.
Under Unix, this also replaces the repeated polling in _Popen.wait() (called 
from Process.join()) with a regular select() call, making it friendlier with 
CPU low-power states.

This is necessary for issue9205.

--
components: Library (Lib)
files: process_sentinel.patch
keywords: patch
messages: 135623
nosy: asksol, brian.curtin, gregory.p.smith, jnoller, neologix, pitrou
priority: normal
severity: normal
stage: patch review
status: open
title: Expose a Process.sentinel property (and fix polling loop in 
Process.join())
type: feature request
versions: Python 3.3
Added file: http://bugs.python.org/file21945/process_sentinel.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com