Java / Java Multithreading
Why do we use ReentrantLock over synchronized (this)?
A ReentrantLock is unstructured and flexible compared to the synchronized constructs. We don't need to use a block structure for locking and can even hold a lock across methods.
Also ReentrantLock supports lock polling and interruptible lock waits that supports time-out. ReentrantLock also has support for configurable fairness policy, allowing more flexible thread scheduling.
More Related questions...