I'm trying to create an Executor Service using a DelayQueue for the blocking queue with Java 8. I created a class that implements Runnable and Delayed ...
I'm trying to create an Executor Service using a DelayQueue for the blocking queue with Java 8. I created a class that implements Runnable and Delayed ...
I'm having a trouble with my code design and can't find a solution. I am implementing a BlockingQueue using Semaphores (TaggedSemaphores, to be precis ...
I'm using multi threading with Java, I have a thread that will post a message into a queue, a blockingQueue which is thread safe, and I have another t ...
I'm currently developing a server that deals with clients using a consumer/producer approach with threads and a blocking collection as shown below: ...
Difference between BlockingQueue and TransferQueue have well explained the difference between these two queues, but looks like TransferQueue is just a ...
I'm reading LinkedBlockingQueue code (JDK8u), and I find LinkedBlockingQueue's head field is not private, but last field is private. I can't find any ...
I saw this self implemented bounded blocking queue. A change was made to it, aiming to eleminate competition by replacing notifyAll with notify. But ...
I have to create message sending application which send SMS to our customers. since generating and sending messages to customers takes considerable ti ...
I have to solve producent-consumer problem using BlockingQueue. I want it to be 1 element queue. So solution have to be: Produce 1 Consume 1 Produce ...
I am trying to write produce and consumer that should print output in below order But it's not giving outputs in order. To achieve order when using ...
I'm developing a class to queue a given number of elements where the reading thread pops and the writing thread pushes them. If the queue is empty the ...
I'm reading up on blockingqueue, executoreserivce and the producer-consumer paradigm. I want to have a changing number of producers, and changing numb ...
So I have a blocking queue implementation. One of the Schedulars is putting a random number to the queue with a delay of 1 seconds, And I have impleme ...
I am writing a small application and I want to have a bounded queue. The naive approach would be to do this: The problem with this is that I get in ...
I am calling shutdown() at the end code , so executor service must immediately shutdown , no previously submitted tasks should execute , but when i ...
The code I type in title doesn't compile. It says: Cannot infer arguments. After that I did BlockingQueue<Integer> a = new PriorityBlockingQueu ...
The source code of put method of LinkedBlockingQueue in JDK 1.8: Why does the current producer need wake up other producers by notFull.signal() whe ...
In BlockingQueue implementations we know that methods put() and take() have blocking nature. What is your advice in solving their endless wait state? ...
Say I make capacity of arrayBlockingQueue and linkedBlockingQueue both to 100. I add only 10 elements in each of them. Will array hold full capacity ...
When I instantiate ArrayBlockingQueue, I must also put int capacity in its constructor. Same thing doesn't apply for LinkedBlockingQueue. I am interes ...