I'm creating a resource pool using a (java) LinkedBlockingQueue, where
- the resource elements are equivalent, belong to a pool where their ordering is indifferent.
- the consumers are competing threads grabbing one resource at a time, with a "pull" operation, working with the resource, and then giving it back to the pool, with an "add" operation.
- While a particular resource is being used by a consumer thread it must not be available to other consumer threads.
The problem is: LinkedBlockingQueue does not make a FIFO of waiting consumers, and the level of service is not uniform.
Any ideas on the topic ? Thanks in advance.