File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Android Security Essentials Live Lessons this week in the Android 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
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