I have implemented consumer-producer with concurrentLinkedList in java. I need to add a request to the head of the queue instead od its tail, in order to set priority. any idea ? thanks
Asked
Active
Viewed 169 times
0
-
1Use a PriorityBlockingQueue? – JB Nizet Nov 12 '16 at 14:15
-
Switch to ConcurrentLinkedQueue https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentLinkedQueue.html – Tizianoreica Nov 12 '16 at 16:04