Tuesday, October 27, 2009

The Global Interpreter Lock

Python technically has threading capabilities. And, it can work quite well if the threads are i/o-bound. However, Python threading doesn't work so well when threads are cpu-bound. The following hour-long video explains why. Read the slides if you are impatient.


One observation that David Beazley makes is that only the "main" thread can deal with signals like Control-C. However, if this thread is blocked via a join(), the signal will not get handled. So, it may be worth creating a thread separate from the "main" thread to spawn and join threads. Haven't yet tested this, though...

No comments:

Post a Comment