[CentralOH] Fwd: Re: Stackless Python
nludban at osc.edu
Wed Nov 4 21:29:26 CET 2009
On Nov 4, 2009, at 2:50 PM, Brian Costlow wrote:
> Didn't see any public responses to your post of your code, wondered
> if you got any private help?
> You do need to add your lock around your 'done' print statement. The
> GIL is removed for I/O and without the lock, these intermix with the
> worker threads' print statements.
OK, try *removing* the with-lock and the print and replace it with
something like this:
s = '%i %f\n' % (me, dividend)
The problem being that all threads were blocking on the one lock waiting
for slow terminal output to complete. Making direct system calls with
the complete string should serialize output and keep threads moving.
More information about the CentralOH