Jython, GILs and object locking.

Andrew Dalke adalke at mindspring.com
Fri Oct 10 23:33:45 EDT 2003


Carl Banks:
> Because, while one processor is doing I/O, the other processor could
> be preparing the next batch of I/O.  I'd guess Python handles this
> particular situation OK, since as we all know, the low-level I/O is
> done without the GIL.

That sounds like you say something is I/O bound when it is
preparing data for I/O as well as when doing I/O.   That's different
than my definition of I/O bound which only includes waiting for
the system to do I/O, and not waiting for the program to create
that batch of I/O

Otherwise the following

import random
for i in range(100):
  sum = 0.0
  for j in xrange(2**30):
    sum = sum + random.random() - 0.5
  print i, sum

would be I/O bound as it's mostly preparing the next batch
of I/O.

                    Andrew
                    dalke at dalkescientific.com






More information about the Python-list mailing list