Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference between syncrornous queue and LinkedBlockingQueue?

 
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
Sheriff
Posts: 3450
163
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
Sheriff
Posts: 3450
163
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
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!