
June 14th, 2004, 12:50 AM
|
 |
Banned ;)
|
|
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
|
|
|
Got to remember that adding threads to a Python program to try speeding it up, does not always work. Reason: Python has a Global Interpreter Lock (GIL) that is set every time you try to access a python object and only the thread that holds the lock can access the object. In order for other threads to get some access to the GIL, the interpreter releases the lock every sys.setcheckinterval bytecodes (default = 10 bytecoee instructions) or if the thread blocks for an I/O operation. This way, another thread can acquire the lock and continue.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
|