[Python-Dev] Python Thread Stack Size

Jack Jansen Jack.Jansen@oratrix.com
Wed, 15 May 2002 00:01:38 +0200


On dinsdag, mei 14, 2002, at 06:30 , Casey Duncan wrote:
> Jim suggested that Python should set the thread stack size 
> itself to something
> like 256 * the pointer size, which would work out to 1Mb on 32 
> bit platforms
> and 2Mb on 64 bit platforms. This would hopefully lead to more 
> consistent
> behavior across platforms.
>
> Alternately (or additionally) it could be a configure option like
> --thread-stack=1024 or somesuch.

At the very least it would need to be configurable. On some 
machines (such as MacOS9 and earlier) the space is actually 
allocated, so by setting it to 2MB you would quickly run out of 
memory.

An even better option might be to let the Python program 
influence the thread stack size (thread.setstacksize(), maybe? 
An optional parameter to the thread start method? A more 
abstract hint not mentioning actual numbers but just 
small/normal/big?), after all it will know (to some extent) 
whether it wants many threads with small stacks or a few threads 
with big stacks.
--
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- 
Emma Goldman -