Re: read write lock in C#
Read the documentation page for ReaderWriterLock and it'll explain the possible errors and also tell you what is/isn't allowed.
Re: read write lock in C#
Thanks Mutant_Fruit,
Quote:
Originally Posted by Mutant_Fruit
Read the documentation page for ReaderWriterLock and it'll explain the possible errors and also tell you what is/isn't allowed.
1.
I have read the document, the issue is, when a thread acquire a read lock, and then upgrade to write lock, the thread is not ensured to continue to hold the lock and proceed executuion, since it will be appended to the end of the write lock queue, and in this scenario a thread which waits for read lock will be awaked, and the awaked thread will hold read lock? Right?
2.
So, if I want a thread to proceed execution and hold lock all the time, I need to let it own write lock at first, other than upgrade?
regards,
George