[python-win32] 1MB Thread Stack Size

Tim Roberts timr at probo.com
Thu Jun 2 20:32:27 CEST 2005


On Wed, 01 Jun 2005 17:25:50 -0700, "Hughes, Chad O" 
<chad.hughes at pnl.gov> wrote:

>I have a program that needs to create a great deal of threads.
>Unfortunately, I cannot seem to find a way to lower the 1MB default
>stack size per thread.  The threading module does not seem to support
>setting the stack size explicitly.  I have 1GB of memory on my system so
>I can only create about 1000 threads before I receive the following
>error trace:
>  
>

It is almost impossible to imagine a situation in which 1,000 threads 
actually provides any productivity.  Any time the number of threads in a 
process is more than an order of magnitude greater than the number of 
CPUs, the operating system administration overhead begins to overwhelm 
the productive work that can be done.

Surely you could solve your problem with 100 threads and some 
appropriate queueing?

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-win32 mailing list