;r') as f with exceptions:
content = f.read()
error = 200
except Exception:
error = 404
Another words from looking at PEP343 it is the author
of the object returned by the with expression that gets
to decide if exceptions are re-raised. But it would seem
to me it should be the programme
plus the not_full Condition variable plus
the call to _put (which is a call to the deque.append)
plus a notify on the not_empty conditional, so it's not
surprising it's slower.
If and when I think Queue is a performance impediment
to an mproc I'll take another look at it, for now
Fredrik,
You are most correct, but Queue is slow compared to deque but
not for the reason I guessed. Apparently it's because deque is
implemented in C while Queue is in python. Using the program below
it looks there is about a 35:1 speed difference.
100 d.append 0.11s 0.1097us p
On Sep 26, 4:47 am, wink <[EMAIL PROTECTED]> wrote:
To make it easier to comment on the code, I'm including
"mproc.py" file below. Fredrik, was commenting about using
Queue and in fact I do. Queue is quite nice and is also
thread safe, which is a requirement for this im
threads without having to contend with the
associated issues mutexes have in the area of deadly embraces or race
conditions.
Anyway, below is a link to the first pass at an implementation
in Python, comments are welcome:
http://www.saville.com/python/mproc.tgz
Regards,
Wink Saville
--
http://