我只是想知道每个会话是否使用相同的线程,或者在请求之间是否计算特定线程是危险的.我得到的是,我可以使用线程静态存储吗?
解决方法
简短的回答是肯定的.用于请求的线程返回到线程池,可用于为其他请求提供服务.它们不是特定于会话的,并且为了回答您的第二个问题,您永远不应指望特定会话上的后续请求可用的特定线程.因此,在ASP.Net中使用线程静态变量是一个非常糟糕的主意.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。