|
-
Queue
I have 2 threads – a producer and a consumer. The producer is expected to produce faster than the consumer can consume – although it is not always the case.
In order to make sure that the consumer consumes the messages in order (FIFO), I plan to use a queue. I am happy that Java 1.5 has introduced a bunch of Queue classes and interfaces into its group of Collection classes and interfaces.
However, there are so many queue implementation classes – which one should I use ?
Should I use a blocking queue ?
Is there a way to prevent the consumer from keep on checking on the contents of the queue ? Will the “blocking” feature address this ?
How do I make sure that my queue is accessed in a thread safe way ? Or is it already thread-safe by default ?
Similar Threads
-
Replies: 4
Last Post: 08-14-2005, 01:03 PM
-
By talz78 in forum VB Classic
Replies: 1
Last Post: 05-01-2005, 07:44 PM
-
By gandangon in forum XML
Replies: 0
Last Post: 04-18-2005, 11:17 PM
-
Replies: 2
Last Post: 01-15-2003, 01:46 PM
-
By Keith Barrows in forum Enterprise
Replies: 0
Last Post: 06-07-2000, 12:22 PM
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks