0

the web layer is coded in asp.net with pages marked as async. Yes, the recommended way to code for aync is using the RegisterAsyncTask

I have a problem now - there are a few pages that have used AutoResetEvent and ManualResetEvent for aync and not the standard RegisterAsyncTask.

Would these objects servicing the async calls, use up the worker threads from the threadpool? (not recommended, as this would exhaust the worker threads and the server would not be able to serve other client requests

OR

would they use the IO threads? (typically IO threads are used for async calls with the RegsterAsyncTask, this is desired)

I would need to propose change to these pages based on your insights. Any opinions please?

4

1 回答 1

1

重置事件对象本身不使用不同的线程——它们只是根据当前状态和其他线程的活动阻塞/释放当前线程。

当您说还有其他页面“已将 AutoResetEvent 和 ManualResetEvent 用于 [s]ync”时,您到底是什么意思?这些是同步对象,并且不提供(本身)使操作异步的方法。其他必须启动线程或使用线程池。

于 2008-12-04T07:11:52.503 回答