Is working with the Session thread-safe?

后端 未结 4 2057
说谎
说谎 2021-02-02 10:57

Consider a user making multiple requests at the same time, do I have to lock all code that works with the Session?

If for example I have the following scenario, where in

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-02 11:34

    In ASP.NET, the Session module uses a pair of reader/writer locks per session, so Request 1 will have consistent reads, and Request 2 will block until Request 1 completes.

提交回复
热议问题