Date: Wed, 2 Jul 2003 10:45:54 +0200 From: Dietmar Grabowski <ceyxx@web.de> To: freebsd-threads@freebsd.org Cc: ceyxx@web.de Subject: libthr und libkse-Probs with python Message-ID: <200307021045.54122.ceyxx@web.de>
next in thread | raw e-mail | index | archive | help
Hi, some testing of libthr and libkse with python: libkse: hangs after 20 seconds, unkillable process libthr: hangs also, but killable i am running current from Mon Jun 30 greeting dietmar --------------------------------- #!/usr/local/bin/python import time, threading, whrandom class MyThread(threading.Thread): """ Each thread picks a 'random' integer between 0 and 19 and reports in once per second for that many seconds. """ def run(self): iterations = whrandom.randint(0, 19) for i in range(iterations): print " ", self.getName(), "is reporting in" time.sleep(1) print self.getName(), "is DONE" if __name__ == '__main__': threadList = [] # Create 200 MyThread() threads for i in range(200) : thread = MyThread() threadList.append(thread) # Start all threads for thread in threadList: thread.start() # As long as we have more than just the 'main' thread running, print # out a status message while threading.activeCount() > 1 : print str(threading.activeCount()), "threads running incl. main" time.sleep(1) -------------------------
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200307021045.54122.ceyxx>