Some questions. Firstly see this code:
2.What differents between Read and Write Locks and UpgradeableReadLock?
3.When I should use these locks? For example: for reading list but I should use Read Lock right? And If I read&write I use Write Lock?
void HelloWorld
{
using (WriteLock.TryEnter(readWriteLock, 1000))
{
SuperFunc()
}
}
void SuperFunc()
{
//Something...
}
1.I called function SuperFunc() with WriteLock but how can I remove readlock later?2.What differents between Read and Write Locks and UpgradeableReadLock?
3.When I should use these locks? For example: for reading list but I should use Read Lock right? And If I read&write I use Write Lock?