• Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference between syncrornous queue and LinkedBlockingQueue?  RSS feed

 
suraj august
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can anyone tell the exact difference between syncrornous queue and LinkedBlockingQueue?
 
Tim Cooke
Marshal
Posts: 3962
234
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reading the documentation for each, and comparing, would be a great place to start.
SynchronousQueue
LinkedBlockingQueue

Is there some particular difference in the docs that you're not clear on?
 
suraj august
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"An optionally-bounded blocking queue based on linked nodes" as written in the docs.

what is the meaning of optiona and bounded.quite confused.!!
 
Tim Cooke
Marshal
Posts: 3962
234
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Optionally-bounded" means that you can set the maximum capacity of the queue (bounded), but you don't have to (optional).
 
S Majumder
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Suraj,

Both are BlockingQueue . The main difference is SynchronousQueue is bounded that is only one queue will run at a time while we can create many queues as per our demand by LinkedBlockingQueue .

First read what is BlockingQueue .Then try to implement different blocking queue .
Try to implement CONSUMER / PRODUCER problems on SynchronousQueue and LinkedBlockingQueue ..

Hope this will help.

Thanks ,
Satya
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!