win32process.beginthreadex allows you to specify the size.  However there is
almost certainly a better way of doing what you want than creating that many
threads, generally using non-blocking operations and an IO Completion Port
- what exactly are you doing?
 
I believe the "stackless" prject is all but dead - but that offered
"micro-threads" for cases where a huge number of threads were desired and
hard to avoid.
 
Mark

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Hughes, Chad O
Sent: Thursday, 2 June 2005 10:26 AM
To: python-win32@python.org
Subject: [python-win32] 1MB Thread Stack Size



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:

  File "C:\Python24\lib\threading.py", line 442, in __bootstrap 
    self.run() 
  File "C:\Python24\lib\threading.py", line 422, in run 
    self.__target(*self.__args, **self.__kwargs) 
  File "C:\tagent\globalModule.py", line 190, in shell 
    self.target() 
  File "C:\tagent\agent.py", line 132, in runLoop 
    self.timeSliceEvent(currentTime,delta) 
  File "C:\tagent\agent.py", line 397, in timeSliceEvent 
    actorInstance.threadStart() 
  File "C:\tagent\agent.py", line 117, in threadStart 
    threading.Thread.start(self) 
  File "C:\Python24\lib\threading.py", line 416, in start 
    _start_new_thread(self.__bootstrap, ()) 
  error: can't start new thread 

Any ideas on how to lower the stack size? 

Chad 

<<attachment: winmail.dat>>

_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to