From: Guido van Rossum Date: Thu, 26 Mar 1998 20:09:16 +0000 (+0000) Subject: Add a sleep(0.00001) call to make sure all threads run. X-Git-Tag: v1.5.1~305 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=07af9a7ddd815db303f67aeeca5c4d968aa120f4;p=python Add a sleep(0.00001) call to make sure all threads run. --- diff --git a/Demo/threads/find.py b/Demo/threads/find.py index d244beaf25..f858ccceb8 100644 --- a/Demo/threads/find.py +++ b/Demo/threads/find.py @@ -77,6 +77,7 @@ class WorkQ: self.mutex.release() def _worker(self): + time.sleep(0.00001) # Let other threads run while 1: job = self._getwork() if not job: @@ -97,6 +98,7 @@ class WorkQ: # Main program def main(): + sys.argv.append("/tmp") nworkers = 4 opts, args = getopt.getopt(sys.argv[1:], '-w:') for opt, arg in opts: