Re: Questions about GIL and web services from a n00b

2011-04-20 Thread Chris H
On 4/19/11 3:48 AM, Lamont Nelson 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

Re: Questions about GIL and web services from a n00b

2011-04-19 Thread Lamont Nelson
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

Re: Questions about GIL and web services from a n00b

2011-04-18 Thread Hank Fay
Today I just happened to watch this session from PyCon 2011 on gevent and gunicorn: http://blip.tv/file/4883016 gevent uses greenlet, fwiw. I found it informative, but then I find most things informative. s H -- http://mail.python.org/mailman/listinfo/python-list

Re: Questions about GIL and web services from a n00b

2011-04-17 Thread sturlamolden
On Apr 15, 6:33 pm, Chris H chris.humph...@windsorcircle.com 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

Re: Questions about GIL and web services from a n00b

2011-04-17 Thread sturlamolden
On Apr 16, 4:59 am, David Cournapeau courn...@gmail.com wrote: My experience is that if you are CPU bound, asynchronous programming in python can be  more a curse than a blessing, mostly because the need to insert scheduling points at the right points to avoid blocking and because profiling

Re: Questions about GIL and web services from a n00b

2011-04-17 Thread sturlamolden
On Apr 17, 12:10 am, Michael Torrie torr...@gmail.com wrote: Many GUI toolkits are single-threaded.  And in fact with GTK and MFC you can't (or shouldn't) call GUI calls from a thread other than the main GUI thread. Most of them (if not all?) have a single GUI thread, and a mechanism by which

Re: Questions about GIL and web services from a n00b

2011-04-17 Thread Ian
On 15/04/2011 20:17, Dan Stromberg wrote: On Fri, Apr 15, 2011 at 9:33 AM, Chris H chris.humph...@windsorcircle.com 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

Re: Questions about GIL and web services from a n00b

2011-04-17 Thread sturlamolden
On Apr 15, 6:33 pm, Chris H chris.humph...@windsorcircle.com 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

Re: Questions about GIL and web services from a n00b

2011-04-17 Thread sturlamolden
On Apr 17, 5:15 pm, Ian hobso...@gmail.com wrote: 5) Even in CPython, I/O-bound processes are not slowed significantly by the GIL.  It's really CPU-bound processes that are. Its ONLY when you have two or more CPU bound threads that you may have issues. And when you have a CPU bound

Re: Questions about GIL and web services from a n00b

2011-04-16 Thread Aahz
In article e6008cc8-50f0-4d78-be78-ec6e73b97...@22g2000prx.googlegroups.com, Raymond Hettinger pyt...@rcn.com wrote: Threading is really only an answer if you need to share data between threads, if you only have limited scaling needs, and are I/O bound rather than CPU bound Threads are also

Re: Questions about GIL and web services from a n00b

2011-04-16 Thread Chris Angelico
On Sun, Apr 17, 2011 at 12:44 AM, Aahz a...@pythoncraft.com wrote: In article e6008cc8-50f0-4d78-be78-ec6e73b97...@22g2000prx.googlegroups.com, Raymond Hettinger  pyt...@rcn.com wrote: Threading is really only an answer if you need to share data between threads, if you only have limited scaling

Re: Questions about GIL and web services from a n00b

2011-04-16 Thread Jean-Paul Calderone
On Apr 16, 10:44 am, a...@pythoncraft.com (Aahz) wrote: In article e6008cc8-50f0-4d78-be78-ec6e73b97...@22g2000prx.googlegroups.com, Raymond Hettinger  pyt...@rcn.com wrote: Threading is really only an answer if you need to share data between threads, if you only have limited scaling needs,

Re: Questions about GIL and web services from a n00b

2011-04-16 Thread Michael Torrie
On 04/16/2011 02:53 PM, Jean-Paul Calderone wrote: On Apr 16, 10:44 am, a...@pythoncraft.com (Aahz) wrote: In article e6008cc8-50f0-4d78-be78-ec6e73b97...@22g2000prx.googlegroups.com, Raymond Hettinger pyt...@rcn.com wrote: Threading is really only an answer if you need to share data

Questions about GIL and web services from a n00b

2011-04-15 Thread Chris H
So I'm in a startup where we are considering using python as our primary development language for all the wonderful reasons you would expect. However, I've had a couple of things come up from mentors and other developers that is causing me to rethink whether python is the right choice. I

Re: Questions about GIL and web services from a n00b

2011-04-15 Thread Chris H
On 4/15/11 1:03 PM, Tim Wintle wrote: 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

Re: Questions about GIL and web services from a n00b

2011-04-15 Thread Tim Wintle
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

Re: Questions about GIL and web services from a n00b

2011-04-15 Thread Dan Stromberg
On Fri, Apr 15, 2011 at 9:33 AM, Chris H chris.humph...@windsorcircle.com 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

Re: Questions about GIL and web services from a n00b

2011-04-15 Thread Raymond Hettinger
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

Re: Questions about GIL and web services from a n00b

2011-04-15 Thread David Cournapeau
On Sat, Apr 16, 2011 at 10:05 AM, Raymond Hettinger pyt...@rcn.com wrote: 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