【发布时间】:2016-04-18 18:35:59
【问题描述】:
我正在经历the completely fair solution to the Readers/Writers problem,释放锁的顺序让我感到困惑。我想知道我们是否可以在reader() 函数中交换释放serviceQueue 锁和readCountAccess 锁的顺序。如果顺序无关紧要,以这种方式释放锁似乎违反直觉。但是我看不出以相反的顺序释放锁有什么问题(首先readCountAccess和然后然后serviceQueue锁)。
【问题讨论】:
标签: multithreading concurrency synchronization theory