We all have used Thread, Runnable to develop multi-threaded applications in Java. While we used Thread and Runnable we had a lot of work to do in terms of assigning the task to the Thread, starting the thread to waiting for it to complete the execution to get the result from each thread. In Java …
java concurrency
Book Review: Java Concurrency in Practice
Lot of us know that writing multi-threaded/concurrent applications in Java is not just about creating Thread objects and passing in Runnable implementations. Few of them mastered the art of concurrent programming and explored alternatives not only provided by Java but other languages like Scala, Groovy, Clojure. But quite a few of us have tried to …
Implementing a Producer-Consumer scenario using BlockingQueue in Java
Before we start with the actual example, lets have a look at the few concepts we should be aware of. Producer-Consumer Problem Wikipedia here says that: The consumer producer problem (also known as the bounded-buffer problem) is a classical example of a multi-process synchronization problem. The problem describes two processes, the producer and the consumer, …