[Tutor] about threads
Ismael Garrido
ismaelgf at adinet.com.uy
Wed Aug 16 09:30:15 CEST 2006
Luke Paireepinart escribió:
> if you run two instances of the python interpreter (like you're doing
> when you start two command windows,)
> they're executing in different threads, it's just that the threads are
> OS level instead of application level.
Bear in mind that python threads have the GIL "Global interpreter lock".
If you've got two processors, one interpreter, and two python threads
there, at most you'll be able to use one processor. The GIL means that
only one instruction at a time can be executed. Depending on what you're
doing and the load you've got, this may or may not be important.
Ismael
More information about the Tutor
mailing list