This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes List vs Queue 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 "List vs Queue" Watch "List vs Queue" New topic

List vs Queue

dushantha Rathnayake
Ranch Hand

Joined: Feb 27, 2010
Posts: 103

I am going to develop a TCP server. In this case I have to do queuing. So currently I'm using List as my queue. But java providing queue object. I want to know what is the best object for do queuing process.

Thank you.
Stephan van Hulst

Joined: Sep 20, 2010
Posts: 3599

Java has a Queue interface. You can take a look for yourself which classes in the standard API implement it that fit your needs. For a simple Queue, I can recommend ArrayDeque. However, you may also want to take a look at classes that implement BlockingQueue or PriorityQueue, if you need their specific semantics.
I agree. Here's the link:
subject: List vs Queue
Similar Threads
getting resolved queue manager name from queue session
Hibernate loses precision when persisting util.Date as timestamp
getting resolved queue manager name from queue session
how efficient are threadds for sending mails??
MQ Publish/Subscribe