views:

521

answers:

1

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?

+1  A: 

The reset event objects don't use different threads themselves - they just block/release the current thread based on the current state and the activities of other threads.

When you say there are other pages "that have used AutoResetEvent and ManualResetEvent for a[s]ync" what exactly do you mean? These are synchronization objects, and don't provide a way (in themselves) of making operations asynchronous. Something else must be starting a thread or using the thread pool.

Jon Skeet