-
December 31st, 2010, 08:03 AM
#16
Re: java.util.NoSuchElementException thrown from java.util.LinkedList.poll
I found that the best class to use for queues in a multithread context is the set of BlockingQueues.
Good to hear you have found a solution.
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).
Yes, if you using these blocking methods there is no need to provide any synchronization because it is handled internally for you.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|