I have some data structure, in which I want to exclusively lock the access for writing, but to enable parallel access for reading.
I made some searches and found out the classes ReadWriteLock
and ReentrantReadWriteLock
- which both supply a read-lock and a write-lock.
I didn't understand what is the difference between them. Could someone please explain?