I am implementing a database which can read and write data. For concurrency issue, I need to implement lock. Normally, ReentrantReadWriteLock will let write execute before read. How Can I go reversely? Is there a way that I can read before write thread executes?
I am implementing a database which can read and write data. For concurrency issue,
Share
Re-read the javadoc of ReentrantReadWriteLock. It doesn’t impose any order between reads and writes. All it does is allowing concurrent reads, but disallowing concurrent writes and writes concurrent with reads.