Another machine that I have access to has problems. It is running python 2.2.2. It's Linux, some RedHat version I think. Here's the output:

% python threadtest.py
Starting new threads
11

And then it hangs.

-winston

On Oct 16, 2004, at 12:24 PM, Winston Wolff wrote:

It works well on my machine, Mac OS X 10.3, 800 MHz. The ending line says:

        OK for 20000 threads - 20 threads runningin parallel 1000

-ww

On Oct 16, 2004, at 12:08 PM, James R. Phillips wrote:

I have been experiencing times when my Webware site
at http://zunzun.com will simply stop running, cause
unknown.  Investigation to date shows that there is some
thread problem, which I would like to discuss.

Below is a simple Python program to test multithreading.
This program runs smoothly and quickly on my home
Windows XP computer as expected.  On the Linux server
where my site resides, it runs slowly and jerkily,
finally ending with the message "Killed".  I would
like to ask that others please try this program and
see how it runs on their computers, this may be why
people occasionally report unexplainable WebKit site
applications stopping.

If there is a problem with my test code, please let
me know.  I do not see one and don't know why it runs
differently on the two computers I have access to.

     James Phillips
     http://zunzun.com

import os, sys, thread

loopCount = 1000
threadCount = 20
threadsRunning = 1
threadsTotal = 0
t = 0
lock = thread.allocate_lock()

def ThreadTest():
    global threadsTotal, threadsRunning, lock
    lock.acquire()
    threadsTotal += 1
    threadsRunning -= 1
    lock.release()

print "Starting new threads"
for i in range(loopCount):
    threadsRunning = threadCount
    for threads in range(threadCount):
        thread.start_new(ThreadTest, ())

    while threadsRunning > 0:
        lock.acquire()
        if threadsTotal != t:
            print threadsTotal,
            sys.stdout.flush()
            t = threadsTotal
        lock.release()

print
print "OK for", threadsTotal, "threads -", threadCount, "threads running
in parallel", loopCount
print




-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss



------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to