I would like to create a shared resource pool that can be accessed by multiple threads at the same time.
Each thread will do something like:
select a resource from the pool (if the resource is unavailable, do something else)
do something with the selected resource
return the resource to the pool.
In java, I will probably go with ConcurrentLinkedQueue.
Is there a better option in scala?
source share