December 31st, 2010, 07:03 AM
Re: java.util.NoSuchElementException thrown from java.util.LinkedList.poll
Good to hear you have found a solution.
I found that the best class to use for queues in a multithread context is the set of BlockingQueues.
Yes, if you using these blocking methods there is no need to provide any synchronization because it is handled internally for you.
No need to synchronize and it is possible to put the thread in wait mode (using the take() method) until new items are posted to the queue (using add() or put() methods).
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!