Python threads: backed by OS threads?

Chuck Esterbrook echuck at mindspring.com
Thu May 11 12:06:07 EDT 2000


Richard Brodie wrote:
> 
> "Courageous" <jkraska1 at san.rr.com> wrote in message news:391A92A4.F64FF43A at san.rr.com...
> 
> > I see. Well, then all things considered, I have no idea why one
> > would want to use python/OS threads at all. The uthread implementation
> > on stackless really rips.
> 
> It depends on your reason for using threads. Sometimes, it just means
> that you can write cleaner code. Having a multiprocessor, and using
> multiple threads, and caring about the execution time of the Python
> interpreter are putting you in something of a minority.
> 
> For one thing, it means that you are using an interpreted language
> for something performance critical. In a lot of problems, the inner
> loop is likely to end up in external modules which will multiprocess
> fine anyway. If yours isn't one of them them sure, go ahead.


The application server in Webware for Python is a good example where:

* You want a great language like Python to develop your website (even if Python is slow).
* There doesn't seem to be a magic inner loop that provides huge optimization pay offs
* Multiple threads are a natural, because it's a server for multiple requests
* Performance is important and multiple CPUs can/should help


So I guess Courageous and I are in the same basic category. I imagine any type of Python-based server would be as well.

-Chuck



More information about the Python-list mailing list