Questions about GIL and web services from a n00b

Tim Wintle tim.wintle at teamrubber.com
Fri Apr 15 13:03:32 EDT 2011


On Fri, 2011-04-15 at 12:33 -0400, Chris H wrote:
> 
> 1. Are you sure you want to use python because threading is not good
> due to the Global Lock (GIL)?  Is this really an issue for
> multi-threaded web services as seems to be indicated by the articles
> from a Google search?  If not, how do you avoid this issue in a
> multi-threaded process to take advantage of all the CPU cores
> available?

Is the limiting factor CPU?

If it isn't (i.e. you're blocking on IO to/from a web service) then the
GIL won't get in your way.

If it is, then run as many parallel *processes* as you have cores/CPUs
(assuming you're designing an application that can have multiple
instances running in parallel so that you can run over multiple servers
anyway).

Tim Wintle




More information about the Python-list mailing list