threaded code in IDLE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matt Leslie

    threaded code in IDLE

    This code:

    **************
    import thread

    def doprint(i):
    print i

    for i in range(0,100):
    thread.start_ne w_thread(doprin t,(i,))
    *************

    Will run fine from the windows command line, but consistently
    crashes IDLE on windows (it locks up with no error message)

    Is this a known bug?

    Is there a workaround?

    Thanks,
    Matt
  • Kurt B. Kaiser

    #2
    Re: threaded code in IDLE

    Matt Leslie <matthewleslie@ hotmail.com> writes:
    [color=blue]
    > This code:
    >
    > **************
    > import thread
    >
    > def doprint(i):
    > print i
    >
    > for i in range(0,100):
    > thread.start_ne w_thread(doprin t,(i,))
    > *************
    >
    > Will run fine from the windows command line, but consistently
    > crashes IDLE on windows (it locks up with no error message)
    >
    > Is this a known bug?[/color]

    Which IDLE? Which Python? Which Windows?

    Works for me on Windows2000, Python 2.3.2, Idle 1.0


    If I run a thousand threads IDLE uses over 64MB unless I add a little
    delay in between spawning threads. Using the Python interpreter, not
    IDLE, I can add a time.sleep(.000 0015) and get away with 10,000
    threads piling up with output to print. IDLE needs more time, try .01
    sec and watch your Task Monitor. (Though 100 threads isn't much of
    a load....)

    --
    KBK

    Comment

    Working...