dcsimg
Using join() as disjunction (OR)
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Andi_New
Posted On:   Monday, February 24, 2003 07:13 AM

Hi Gurus


Please can anyone help me ?



I have a main thread that is forked into 3 threads
(main thread and 2 other threads)

Now the main thread waits until the fastest one of the 2 threads finishes. (OR gate)
Is this possible with join() ?

I need to know, which one of the 2 threads did finish first and then stop the slower thread



Thanks

Re: Using join() as disjunction (OR)

Posted By:   Edward_Harned  
Posted On:   Monday, February 24, 2003 02:02 PM

Forget join().


Search the forum for wait() and notifyAll().


The main thread waits for either thread to finish. The first thread to finish sets an indicator as to who it is and issues notifyAll().

About | Sitemap | Contact