Will a ASP.NET session reader lock block a writer lock?
I found some description about writer lock and reader lock b开发者_StackOverflowlocking behavior from Patrick's Understanding session state modes + FAQ:
Reader lock will block a writer lock; Reader lock will NOT block reader lock; Writer lock will block all reader and writer lock.
I designed some tests to prove "writer lock will block all reader and writer lock" and "reader lock will not block reader lock" successfully. But in my test, it seems "reader lock WILL NOT block writer lock either" (there is more detail about the test in my post) and I didn't find more researches on this issue, has anybody ever proven it?
From MSDN
If the EnableSessionState value in the @ Page directive is set to ReadOnly, a request for the read-only session information does not result in an exclusive lock on the session data. However, read-only requests for session data might still have to wait for a lock set by a read-write request for session data to clear.
精彩评论