Threads in Python
Warren Postma
embed at geocities.com
Mon Feb 14 10:02:42 EST 2000
> As Fredrik said, yes and no. Threads are incredibly easy to use in
> Python; the biggest drawback is the Python global interpreter lock,
> which means that only one thread can run Python code at any time.
> That's usually not a big drawback, because threading is usually used to
> optimize I/O, and extension libraries (including I/O) can release the
> global lock.
What about pre-emption? Can the Python interpreter pre-emptively switch
threads
between any two lines of Python code? Is there a "Schedule()" call to force
a thread to
give up it's timeslice?
Warren
More information about the Python-list
mailing list