wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 1753
    
    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.
 
Consider Paul's rocket mass heater.
 
subject: How can i Initilise PrimeRacers before anyworker Thread is Started?
 
Similar Threads
Access HashMap by multiple threads concurrently
Sieve of Eratosthenes
Threads and DB Access
Issue with executor thread pool
InterruptedException