On Sep 17, 7:02 am, Carl Banks <pavlovevide...@gmail.com> wrote: > On Sep 16, 9:33 pm, Steven D'Aprano > > <ste...@remove.this.cybersource.com.au> wrote: > > def minmax(seq): > > result = [None, None] > > t1 = MMThread(seq, min, result, 0) > > t2 = MMThread(seq, max, result, 1) > > t1.start() > > t2.start() > > # Block until all threads are done. > > while any([t1.isAlive(), t2.isAlive()]): > > time.sleep(0) > > Why not use "t1.join(); t2.join()" here? Is there any benefit to do > it this way instead? > > Carl Banks
The benefit is that SIGINT (Control-C) will be handled. Not sure why sleep(0) is used, though, rather than something less busy like sleep (0.5). -- http://mail.python.org/mailman/listinfo/python-list