My results on Windows 2000:

   OK for 20000 threads - 20 threads running in parallel 1000

Results on Linux (Red Hat 7.3):

   OK for 20000 threads - 20 threads running in parallel 1000

Interestingly, on Windows (in a DOS window) if the window has focus, it
runs very slowly. Bring another window forward, and the thread test runs
at almost Linux-speed ;-)

Cheers!
--
David Hancock | [EMAIL PROTECTED] | 410-266-4384 


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of James
R. Phillips
Sent: Saturday, October 16, 2004 12:09 PM
To: [EMAIL PROTECTED]
Subject: [Webware-discuss] WebKit thread deaths cause found?


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

Reply via email to