Do ASP.NET developers really need to be concerned with thread safety?

前端 未结 4 1453
陌清茗
陌清茗 2021-02-01 20:24

I consider myself aware of the concepts of threading and why certain code is or isn’t “thread-safe,” but as someone who primarily works with ASP.NET, threading and thread safety

4条回答
  •  南旧
    南旧 (楼主)
    2021-02-01 20:28

    Only if you create, within the processing stream for a single HTTPRequest, multiple threads of your own... For e.g., if the web page will display stock quotes for a set of stocks, and you make separate calls to a stock quote service, on independant threads, to retrive the quotes, before generating the page to send back to the client... Then you would have to make sure that the code you are running in your threads is thread-safe.

提交回复
热议问题