A possible bug in python threading/time module?

vm_usenet vm_usenet at yahoo.com
Sat Jul 5 12:56:35 EDT 2003


"Tim Peters" <tim.one at comcast.net> wrote in message news:<mailman.1057347547.21819.python-list at python.org>...
> [Tim]
> > Turns out that the Windows implementation of the Python C API function
> > PyThread_start_new_thread() contained several "laziness" errors
> >
> > ...
> >
> > I'm testing putative fixes on a Win98 box and don't see any hangs any
> > more. However, with more than about 3000 threads,
> >
> >     thread.error: can't start new thread
> >
> > gets raised because MS's _beginthread() fails (with errno == EAGAIN ==
> > "there are too many threads").
> 
> FYI, these fixes have been checked in and will be part of 2.3 final (and
> 2.2.4, if that's ever released).
> 
> The maximum number of threads you can have alive simultaneously on 32-bit
> Windows in an all-default Python build is actually about 2000.  This is
> because each thread gets a megabyte of stack space by default, and 2048
> threads would entirely exhaust the 31-bit user virtual address space just
> for thread stacks.  If you want to know more about that, Google on
> 
>     CreateThread default stack size
> 
> The top hit is to the current relevant MSDN docs.

I'm sorry that this comes immediately after my recent post, and that,
of all places, I am forced to put it here.

Right after I read Tim's recent post, I went to the python CVS and
noted that Tim refered to me as an 'anonymous coward'. Well Tim, I
just wanted to say that I appreciate you being part of the community,
too.

I hope to see more mature people working on the Python project than
Tim.

vm




More information about the Python-list mailing list