We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JDBM currently uses ReadWriteLock and plain synchronized. This is not enough for our needs. We should use tri-state locks:
ReadWriteLock
synchronized
It should behave similar as ReadWriteLock, but read-for-write should not block other read, but should block other read-for-write. Example usage:
read-for-write
read
public V ConcurrentMap.putIfAbsent(K key, V value) { lock.readWriteLock().lock(); try{ V oldKey = get(key) if(oldKey!=null) return oldKey; lock.writeLock.lock(); try{ return put(key, value); }finally{ lock.writeLock.unlock() } }finally { lock.readWriteLock().unlock(); } }
The text was updated successfully, but these errors were encountered:
Closing, not going to fix right now
Sorry, something went wrong.
No branches or pull requests
JDBM currently uses
ReadWriteLock
and plainsynchronized
. This is not enough for our needs. We should use tri-state locks:It should behave similar as
ReadWriteLock
, butread-for-write
should not block otherread
, but should block otherread-for-write
. Example usage:The text was updated successfully, but these errors were encountered: