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

Discussion in 'Python' started by Tim Peters, Jul 4, 2003.

  1. Tim Peters

    Tim Peters Guest

    [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.
     
    Tim Peters, Jul 4, 2003
    #1
    1. Advertising

  2. Tim Peters

    vm_usenet Guest

    "Tim Peters" <> wrote in message news:<>...
    > [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
     
    vm_usenet, Jul 5, 2003
    #2
    1. Advertising

  3. Tim Peters

    vm_usenet Guest

    "Tim Peters" <> wrote in message news:<>...
    > [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
     
    vm_usenet, Jul 5, 2003
    #3
  4. Tim Peters

    Peter Hansen Guest

    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
     
    Peter Hansen, Jul 5, 2003
    #4
  5. Tim Peters

    Aahz Guest

    Name-based insults, round 5 (was Re: A possible bug in python threading/time module?)

    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.
     
    Aahz, Jul 5, 2003
    #5
  6. On 5 Jul 2003 09:56:35 -0700, (vm_usenet) wrote:

    >"Tim Peters" <> wrote in message news:<>...
    >> [Tim]

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

    LOL ;-)

    Regards,
    Bengt Richter
     
    Bengt Richter, Jul 5, 2003
    #6
  7. Tim Peters

    vm_usenet Guest

    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!
     
    vm_usenet, Jul 6, 2003
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vm_usenet
    Replies:
    0
    Views:
    338
    vm_usenet
    Jul 2, 2003
  2. flamesrock
    Replies:
    8
    Views:
    484
    Hendrik van Rooyen
    Nov 24, 2006
  3. Replies:
    9
    Views:
    1,055
    Mark Space
    Dec 29, 2007
  4. Steven Woody
    Replies:
    0
    Views:
    431
    Steven Woody
    Jan 9, 2009
  5. Steven Woody
    Replies:
    0
    Views:
    461
    Steven Woody
    Jan 9, 2009
Loading...

Share This Page