Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > RE: A possible bug in python threading/time module?

Reply
Thread Tools

RE: A possible bug in python threading/time module?

 
 
Tim Peters
Guest
Posts: n/a
 
      07-04-2003
[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.


 
Reply With Quote
 
 
 
 
vm_usenet
Guest
Posts: n/a
 
      07-05-2003
"Tim Peters" <> wrote in message news:<mailman.1057347547.21819.python->...
> [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 understand what you are saying. Obviously there is a limit for the
amount of threads running at the same time. Thank you for taking the
time to find the problems, and for fixing them.

Here's to a better Python!

vm
 
Reply With Quote
 
 
 
 
vm_usenet
Guest
Posts: n/a
 
      07-05-2003
"Tim Peters" <> wrote in message news:<mailman.1057347547.21819.python->...
> [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
 
Reply With Quote
 
Peter Hansen
Guest
Posts: n/a
 
      07-05-2003
vm_usenet wrote:
>
> 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.


See http://www.computerhope.com/jargon/a/ac.htm, definition #2. This
is a fairly well-known term for someone who, like you, for some
strange reason does not want to use their name in discourse with
others (such as those who are helping them, hint, hint) online.

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


If you mean you want a greater number of mature people than just
Tim alone working on the Python project, then we can all agree and,
fortunately, that is the current situation.

If you meant something else, I suggest you learn more about Python
history and about those who have really made Python what it is before
you make comments of that nature.

-Peter
 
Reply With Quote
 
Aahz
Guest
Posts: n/a
 
      07-05-2003
In article <>,
Peter Hansen <> wrote:
>vm_usenet wrote:
>>
>> 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.

>
>See http://www.computerhope.com/jargon/a/ac.htm, definition #2. This
>is a fairly well-known term for someone who, like you, for some
>strange reason does not want to use their name in discourse with
>others (such as those who are helping them, hint, hint) online.


(We've just been through this recently, but...) I don't think that the
prevalence of a term says anything about its potential for insult. I'm
sure you can think of many examples on your own.
--
Aahz () <*> http://www.pythoncraft.com/

Usenet is not a democracy. It is a weird cross between an anarchy and a
dictatorship.
 
Reply With Quote
 
Bengt Richter
Guest
Posts: n/a
 
      07-05-2003
On 5 Jul 2003 09:56:35 -0700, (vm_usenet) wrote:

>"Tim Peters" <> wrote in message news:<mailman.1057347547.21819.python->...
>> [Tim]

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

LOL

Regards,
Bengt Richter
 
Reply With Quote
 
vm_usenet
Guest
Posts: n/a
 
      07-06-2003
Peter Hansen <> wrote in message news:<>...
> vm_usenet wrote:
> >
> > 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.

>
> See http://www.computerhope.com/jargon/a/ac.htm, definition #2. This
> is a fairly well-known term for someone who, like you, for some
> strange reason does not want to use their name in discourse with
> others (such as those who are helping them, hint, hint) online.
>
> > I hope to see more mature people working on the Python project than
> > Tim.

>
> If you mean you want a greater number of mature people than just
> Tim alone working on the Python project, then we can all agree and,
> fortunately, that is the current situation.
>
> If you meant something else, I suggest you learn more about Python
> history and about those who have really made Python what it is before
> you make comments of that nature.
>
> -Peter


Ok, Ok...

I beg the forgiveness of everyone whom I insulted. I wasn't aware of
the
term 'Anonymous Coward' and so I interpreted it as an insult.

Tim - I'm sorry and I won't be making that mistake again.

And on that opportunity, I'd really like to admit that you indeed did
your work perfectly.

I love the Python language very much and I went through hell making my
organization adopt it as its formal prototyping and scripting
language.

Keep up the good work, everyone!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[BUG] Ruby 1.9.0: possible bug when subclassing BasicObject Michael Fellinger Ruby 3 12-27-2007 04:05 PM
efficient data loading with Python, is that possible possible? igor.tatarinov@gmail.com Python 10 12-14-2007 04:44 PM
*bug* *bug* *bug* David Raleigh Arnold Firefox 12 04-02-2007 03:13 AM
Re: Possible fix for Bug 494589 - os.path.expandvars bug Steve Holden Python 1 07-02-2003 09:42 PM
A possible bug in python threading/time module? vm_usenet Python 0 07-02-2003 08:39 AM



Advertisments