Using threads in python is safe ?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Wed Mar 19 13:15:14 EDT 2008


En Wed, 19 Mar 2008 04:43:34 -0300, Deepak Rokade <smartpawn at gmail.com>  
escribió:

> Thanks all for removing confusion about GIL,
> one more question;
> If jobs to be processed by threds is I/O bound would multithreading help
> python to improve speed of application ?
> Since I read that " multithreading is not a good strategy to improve  
> speed
> of python application."

Try and see what happens in your specific case. People keeps saying that  
but I've never seen conclusive evidence on this topic. Using several  
threads for I/O bound tasks seems reasonable to me, and is the easiest  
approach. For CPU bound tasks, multiple threads won't help much, be it  
Python or another language.
I mean, a reasonable number of threads with a reasonable task load. A  
server handling thousands of simultaneous connections is another beast.

-- 
Gabriel Genellina




More information about the Python-list mailing list