GIL and uniprocessor machines

Joe Cheng code at joecheng.com
Wed Jun 4 00:13:32 CEST 2003


> > You're half-right.  However, even on a single-CPU machine, handling
> > multiple I/O requests concurrently does give a speed boost, which is why
> > Python has a mechanism for releasing the GIL in C extensions -- and all
> > the reentrant-capable I/O calls in the standard library release the GIL.
> 
> More generally, in a single processor machine, the system may be able
> to switch threads at a time it considers appropriate. With the GIL,
> the system's choice of alternative new threads is reduced to
> non-Python threads, unless the active Python thread has released the
> GIL.

Makes sense.  Thanks, both of you!




More information about the Python-list mailing list