python threads?

Cole Tuininga colet-KCgK2vT7wad/90uGnh1m2w at public.gmane.org
Sun May 27 14:14:46 EDT 2007


Unfortunately, you're running into one of the little secrets of
python ... the GIL (Global Interpreter Lock).  While python has support
for "multithreading", it doesn't work the way you would normally think
of threading.  If it still works the way it used to, the python
interpreter basically runs 10 pseudo instructions (barring running into
some kind of blocking call) and then swaps off to another thread.

If you truly want to use multiple processors for a python program,
multi-process with (your choice of) IPC is going to be the way to go.

-- 
A: Yes.                                                               
> Q: Are you sure?                                                    
>> A: Because it reverses the logical flow of conversation.           
>>> Q: Why is top posting annoying in email?

Cole Tuininga
colet-KCgK2vT7wad/90uGnh1m2w at public.gmane.org
http://www.code-energy.com/


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.






More information about the Discuss mailing list