1.1 --- a/pprocess.py Sun Nov 19 00:10:28 2006 +0000
1.2 +++ b/pprocess.py Sun Nov 19 19:36:11 2006 +0000
1.3 @@ -4,7 +4,7 @@
1.4 A simple parallel processing API for Python, inspired somewhat by the thread
1.5 module, slightly less by pypar, and slightly less still by pypvm.
1.6
1.7 -Copyright (C) 2005 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2005, 2006 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This software is free software; you can redistribute it and/or
1.11 modify it under the terms of the GNU General Public License as
1.12 @@ -120,6 +120,10 @@
1.13
1.14 It would seem, from using sockets and from studying the asyncore module, that
1.15 sockets are more predictable than pipes.
1.16 +
1.17 +Notes about poll implementations can be found here:
1.18 +
1.19 +http://www.greenend.org.uk/rjk/2001/06/poll.html
1.20 """
1.21
1.22 __version__ = "0.2.2"
1.23 @@ -244,6 +248,7 @@
1.24
1.25 self.autoclose = autoclose
1.26 self.readables = {}
1.27 + self.removed = []
1.28 self.poller = select.poll()
1.29 for channel in channels or []:
1.30 self.add(channel)
1.31 @@ -271,6 +276,8 @@
1.32
1.33 fds = self.poller.poll(timeout)
1.34 readables = []
1.35 + self.removed = []
1.36 +
1.37 for fd, status in fds:
1.38 channel = self.readables[fd]
1.39 removed = 0
1.40 @@ -279,6 +286,7 @@
1.41
1.42 if status & (select.POLLHUP | select.POLLNVAL | select.POLLERR):
1.43 self.remove(channel)
1.44 + self.removed.append(channel)
1.45 removed = 1
1.46
1.47 # Record readable channels.