Semaphore in Java

Semaphore guards a shared resource allowing only a defined number of threads to operate at a time. General behavior is as follows: Conceptually, a Semaphore maintains a set of permits.…

Continue Reading

ReadWriteLock in Java

ReadWriteLock provides similar functionality as ReentrantLock. You can create read lock and write lock  from ReadWriteLock. Read lock does not block other threads allowing read operations. Write lock blocks other…

Continue Reading

Lock/ReentrantLock in Java

Lock implementations guards a shared resource allowing a single thread to operate at a time. Lock implementations provide more extensive locking operations than can be obtained using synchronized methods and…

Continue Reading
Close Menu