Many threads may populate a HashMap, in some cases I need to wait (block) until an object exists in the HashMap, such as:
BlockingConcurrentHashMap map = new BlockingConcurrentHashMap();
Object x = map.getAndWait(key, 1000); //(object_to_get, max_delay_ms)
Wondering if such a thing exists already, I hate re-inventing wheels.
As far as I know, there is no ‘Transfer Map’ available. Though the creation of one in theory isn’t too difficult.
There are obvious exclusions in this class. Not to mentioned the lock coarsening; needless to say it won’t perform great, but you should get the idea of what is going on