[concurrency-interest] Replacement for new Thread and a run loop?

Robert Nicholson robert.nicholson at gmail.com
Thu Oct 7 20:13:43 EDT 2010


If you're concerned about your thread dying or disappearing whenever you use new Thread with  run forever/running loop what is the "concurrent" equivalent? 

Is it a ScheduledExecutor where because there's a pool you're always guaranteed to have a Thread
available to process your tasks?

Also, if you use a LinkedBlockingQueue is it important to code defensively to not keep putting this in your queue if there's no consumer taking things from the queue? ie. Do you code for this possibility by abandoning your loop where you are doing your "offer" if it fails too many times?

Cheers.





More information about the Concurrency-interest mailing list