Should this “singleton” be thread-safe in an ASP.NET app?

江枫思渺然 提交于 2019-12-05 23:07:08

Access the Session is already Thread safe.

In general as long as you access any shared state in your static properties in a thread-safe manner, you won't have any problems.

ASP session state comes with a synchronizing logic. If the executed page needs write access to the session state, the session state is locked and other request on the same session has to wait until the first one finishes.

See Synchronizing Access to the Session State.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!