1,833 views
0 votes
0 votes

In Navathe the operations of read/write or shared/exclusive locks are given below....

In the unlock(X) operation...if no.of reads = 0...then lock(X)="unlocked"; and wake up  one of the waiting transactions if any

My question is if it is read lock then why any transaction will wait in a queue? We can have a read lock even if other transaction is holding a read lock on same data item......Please explain

1 Answer

1 votes
1 votes

In read lock we can accept all read item in sheared lock mode. But in that time if any write item come it cannot accept in shared mode. So, it have to wait till the last read item exits and then it access the data in exclusive lock mode

So, we can say read item is shared mode when it is read item only , but for write item it have to wait for getting exclusive lock

Related questions