In a multithreaded environment, what is the policy regarding the take()
method (removing an Object) for the various implementations of Java's BlockingQueue
(for example LinkedBlockingQueue
)?
Does the thread that calls take()
first get the first available Object, e.g. is it a first come, first served, random, or is there some other policy describing how the queue is accessed by multiple threads? I cannot seem to find anything in the docs.