Jython, GILs and object locking.

John J. Lee jjl at pobox.com
Sat Oct 11 07:57:16 EDT 2003


"Jon Franz_antispam" <jfranzXREMOVEX at neurokode.com> writes:

> > What you wrote is flatly wrong: no matter how often you don't use
> > extension modules, Python still *can* use multiple CPUs.
> 
> I stand corrected. 
> 
> > The correct statement is, "Because of the GIL, only one processor can
> > run Python bytecode at the same time."  And it's best to add something
> > like, "However, many functions, especially I/O functions, are written
> > in C, and release the GIL while they work, so that Python can get some
> > use out of multiple processors."
> 
> With the (massive) correction - do you think it should be mentioned in the 
> docs?  I still lean in favor.

+1.  Submit a patch!

Of course, it's still not true that you *need* C code to make use of
multiple processors when you're using threads -- you can have bunches
(strings? ropes?) of threads in separate processes.  And if you only
think you need threads <wink>, you can use POSH, Pyro, or similar, or
switch to select-based stuff, etc...


John




More information about the Python-list mailing list