简体   繁体   English

可以同时在同一个线程上发生对IIS的多个请求吗?

[英]Can multiple requests to IIS occur on the same thread at the same time?

Can two requests to IIS run on the same thread at the same time (ie, interleaving instructions)? IIS的两个请求可以同时在同一个线程上运行(即交错指令)吗? If so, how could this affect a lock that tries to limit access to a shared resource? 如果是这样,这怎么会影响试图限制对共享资源的访问的锁?

If I'm understanding your question correctly, they would run, but both wouldn't be able to lock the same resource at the same time: 如果我正确理解你的问题,它们会运行,但两者都无法同时锁定同一个资源:

Similar question here: What happens when two threads ATTEMPT to lock the same resource at the exact same time? 类似的问题: 当两个线程ATTEMPT在同一时间锁定相同的资源时会发生什么?

In this situation, you'd really want to make use of the async keyword and have one await the other. 在这种情况下,你真的想要使用async关键字并让一个等待另一个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM