Friday, 20 April 2018

Locks in java






If you want to share or update the same data then the activity must be synchronized to avoid the error.in java using synchronize, wait, and notify keyword we can achieve in java.

If you want to perform and share same data then the activity must have control over it or you can say have the lock.








There are 4 type of lock:

1. Fat lock: where multiple thread have waited simultaneously for the lock.

2. Thin lock:  No thread waited for this lock,

3. Recursive lock: Same thread have taken the lock server times.

3. Lazy lock: Lock accrued by thread and not sure will it release or not

No comments:

Post a Comment

session-per-request in hibernate

The most common pattern in a multi-user client/server application is session-per-request . In this model, a request from the client is sent...