Is working with the Session thread-safe?

后端 未结 4 2063
说谎
说谎 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条回答
  •  广开言路
    2021-02-02 11:31

    Yes, Session is thread-safe.

    There's no need to lock anything. However, the need to check the values never cease to be essential.

    Update

    Check @Peter Ruderman's answer :)

    I will have the decency of not copying it :)

提交回复
热议问题