I am very poor in MultiThreading concepts of Java.
I was going through ReentrantLock features and usage. I got that it is more flexible then synchronized and adds few more features.
I can see the examples mentioned on it and I got it well.
I am not able to figure out the real time scenario where exactly it will be helpful in business.
I can see that it will be best to avoid deadlocks.
Can some one provide the use case where without ReentrantLock it will be difficult to solve such use case.
or can point to some link will be helpful.
For a simple case how about timed lock / or partial lock for a application which demands performance.
A Very common example would be online portals which let you buy/book tickets(any). You get a timed lock on the seat/resource you are interested in. After the time expires and if transaction is not completed any other client application(thread) can acquire lock on it.