1.1 --- a/README.txt Sun Nov 19 00:10:28 2006 +0000
1.2 +++ b/README.txt Sun Nov 19 19:36:11 2006 +0000
1.3 @@ -59,6 +59,8 @@
1.4 * Fixed the PyGmy raytracer example's process accounting by relying on the
1.5 possibly more reliable Exchange behaviour, whilst also preventing
1.6 erroneous creation of "out of bounds" processes.
1.7 + * Added a removed attribute on the Exchange to record which channels were
1.8 + removed in the last call to the ready method.
1.9
1.10 New in parallel 0.2.1 (Changes since parallel 0.2)
1.11 --------------------------------------------------
2.1 --- a/pprocess.py Sun Nov 19 00:10:28 2006 +0000
2.2 +++ b/pprocess.py Sun Nov 19 19:36:11 2006 +0000
2.3 @@ -4,7 +4,7 @@
2.4 A simple parallel processing API for Python, inspired somewhat by the thread
2.5 module, slightly less by pypar, and slightly less still by pypvm.
2.6
2.7 -Copyright (C) 2005 Paul Boddie <paul@boddie.org.uk>
2.8 +Copyright (C) 2005, 2006 Paul Boddie <paul@boddie.org.uk>
2.9
2.10 This software is free software; you can redistribute it and/or
2.11 modify it under the terms of the GNU General Public License as
2.12 @@ -120,6 +120,10 @@
2.13
2.14 It would seem, from using sockets and from studying the asyncore module, that
2.15 sockets are more predictable than pipes.
2.16 +
2.17 +Notes about poll implementations can be found here:
2.18 +
2.19 +http://www.greenend.org.uk/rjk/2001/06/poll.html
2.20 """
2.21
2.22 __version__ = "0.2.2"
2.23 @@ -244,6 +248,7 @@
2.24
2.25 self.autoclose = autoclose
2.26 self.readables = {}
2.27 + self.removed = []
2.28 self.poller = select.poll()
2.29 for channel in channels or []:
2.30 self.add(channel)
2.31 @@ -271,6 +276,8 @@
2.32
2.33 fds = self.poller.poll(timeout)
2.34 readables = []
2.35 + self.removed = []
2.36 +
2.37 for fd, status in fds:
2.38 channel = self.readables[fd]
2.39 removed = 0
2.40 @@ -279,6 +286,7 @@
2.41
2.42 if status & (select.POLLHUP | select.POLLNVAL | select.POLLERR):
2.43 self.remove(channel)
2.44 + self.removed.append(channel)
2.45 removed = 1
2.46
2.47 # Record readable channels.