Jython, GILs and object locking.

Jon Franz_antispam jfranzXREMOVEX at neurokode.com
Fri Oct 10 21:28:06 EDT 2003


> I see a big gaping hole in your list of reasons for needing threads.
> > Big, I/O bound network servers can benefit greatly from
> > threads on multiple CPUs.
> 
> Um... I don't get it. If the speed of the application is
> limited by I/O operations, then how would it help to run on
> more CPUs? The speed is still limited by the I/O operations.

Sorry, I should of been more clear - network servers that do 
some processing in addition to I/O.  Zope comes to mind, as 
do several other dynamic-content systems.  Multiple threads 
across CPUs allow for simultaneous I/O and processing, 
without either side being slowed by the other.  


> In principle, I think mentioning this is a good idea.
> HOWEVER, I have seen lots of newbies who think that Python
> can't use threading (at all!) because of the GIL. And
> that's simply wrong. So the warning would need to be
> worded very carefully.

Very true, giving a incorrect or bad impression would be, well, bad.

How about something like:

"Please note that threads created with this module may not take full 
advantage of multiprocessor systems.  For futher information on 
this issue, please refer to XXX." 

Where XXX is a reference describing the GIL and the limitations it 
imposes.

Good, bad, ugly?

~Jon Franz
NeuroKode Labs, LLC







More information about the Python-list mailing list