From owner-freebsd-threads@FreeBSD.ORG Wed Jul 2 01:42:36 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6654537B401 for ; Wed, 2 Jul 2003 01:42:36 -0700 (PDT) Received: from emeise-software-design.de (emeise-software-design.de [217.160.109.8]) by mx1.FreeBSD.org (Postfix) with SMTP id 027A143FF5 for ; Wed, 2 Jul 2003 01:42:33 -0700 (PDT) (envelope-from ceyxx@web.de) Received: (qmail 95078 invoked from network); 2 Jul 2003 08:46:00 -0000 Received: from unknown (HELO c226069.adsl.hansenet.de) (213.39.226.69) by p15093550.pureserver.info with SMTP; 2 Jul 2003 08:46:00 -0000 From: Dietmar Grabowski To: freebsd-threads@freebsd.org Date: Wed, 2 Jul 2003 10:45:54 +0200 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200307021045.54122.ceyxx@web.de> cc: ceyxx@web.de Subject: libthr und libkse-Probs with python X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ceyxx@web.de List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2003 08:42:36 -0000 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) -------------------------