The disadvantage is that very little state information can be stored, so SRW locks do not detect incorrect recursive use in shared mode. The advantage is that it is fast to update the lock state. There is no guarantee about the order in which threads that request ownership will be granted ownership SRW locks are neither fair nor FIFO.Īn SRW lock is the size of a pointer. If a thread tries to acquire a lock that it already holds, that attempt will fail (for TryAcquireSRWLockExclusive) or deadlock (for AcquireSRWLockExclusive)Ī single SRW lock can be acquired in either mode reader threads can acquire it in shared mode whereas writer threads can acquire it in exclusive mode. Exclusive mode SRW locks cannot be acquired recursively.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |