开发者

Ordering in ReaderWriterLock

开发者 https://www.devze.com 2023-01-10 23:01 出处:网络
When I use lock(){...}, I cannot garantee which thread开发者_运维问答 will enter the lock first.

When I use lock(){...}, I cannot garantee which thread开发者_运维问答 will enter the lock first.

What about ReaderWriterLock? Does it works like a FIFO for the writers or not?


What about ReaderWriterLock? Does it works like a FIFO for the writers or not?

It does.

And you pay a performance penalty for this, which is why ReaderWriterLockSlim was introduced—less overhead but it isn't "fair".

0

精彩评论

暂无评论...
验证码 换一张
取 消