Quantcast
Channel: Recent Discussions — Photon Engine
Viewing all articles
Browse latest Browse all 15755

Write&Read Locks

$
0
0
Some questions. Firstly see this code:

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?

Viewing all articles
Browse latest Browse all 15755

Trending Articles