aspose file tools*
The moose likes Threads and Synchronization and the fly likes How can i Initilise PrimeRacers before anyworker Thread is Started? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "How can i Initilise PrimeRacers before anyworker Thread is Started?" Watch "How can i Initilise PrimeRacers before anyworker Thread is Started?" New topic
Author

How can i Initilise PrimeRacers before anyworker Thread is Started?

barnie stinson
Greenhorn

Joined: Oct 10, 2012
Posts: 1
Hi All,

i would like to know how can i initialise all the primeRacers before any worker thread is started. In the following code:


Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1667
    
    7

I think the easiest way would be to have all the threads rendezvous at a CountDownLatch.


Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
 
jQuery in Action, 2nd edition
 
subject: How can i Initilise PrimeRacers before anyworker Thread is Started?
 
Similar Threads
Sieve of Eratosthenes
InterruptedException
Access HashMap by multiple threads concurrently
Issue with executor thread pool
Threads and DB Access