Is Visual Studio Asp.Net Development Server Really Multithreaded?

I am debugging a WebProject in VS2010 that runs on a local dev server (cassini?). One of the aspx pages calls the ManualResetEvent.WaitOne () page, and the other aspx page calls the ManualResetEvent.Set () (in the same global object) to free the first page.

When I look at the thread list in VS2010, there seem to be a lot of worker threads. However, the web server seems to stop processing something, blocked by a call to ManualResetEvent.WaitOne (). Therefore, ManualResetEvent.Set () is not loaded if .WaitOne () time is missing.

What's going on here?

// Sample Code Class SyncTest { private System.Threading.ManualResetEvent eConnected = new System.Threading.ManualResetEvent(false); private bool isConnected; public SyncTest () { this.isConnected = false; } public void SetConnected(bool state) { isConnected = state; if (state) eConnected.Set(); else eConnected.Reset(); } public bool WaitForConnection(int timeout) { return eConnected.WaitOne(timeout); } } 
+2
source share
1 answer

The web server processes only one page at a time from each user.

If you want the pages requested by one user to run in parallel, you must make the pages (except for one) without a session.

Put EnableSessionState="false" in the @Page directive for the page to make it @Page .

This, of course, means that you cannot identify the request using session data. If you want to know who requested the page, you need to send it in the request.

+3
source

Source: https://habr.com/ru/post/907046/


All Articles