PC Review


Reply
Thread Tools Rate Thread

Can an ASP.NET application be forced to run single-threaded?

 
 
=?Utf-8?B?Um9iYiBHaWxtb3Jl?=
Guest
Posts: n/a
 
      8th Mar 2005
We inherited an ASP.NET application which is not thread-safe. Many copies of
this application are in the field and customers are having problems, which we
believe is due to the thread safety problem.

Is there any way to configure IIS to run single-threaded, so that these
customers can get along without errors until we can get them updated software?

Some will have IIS 5.0 ( Win2K and WinXP ) and some will have IIS 6.0 (
Win03 ). For the Win03 servers, we have set the "worker processes" in the
application pool to be 1. But we are not convinced this is truly making the
app single threaded. Is it? For IIS 5.0, we don't know how to single thread
it, or if it's even possible.

Thanks!
Robb
 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      9th Mar 2005
Robb,

How did you made it multithreaded?

Cor


 
Reply With Quote
 
=?Utf-8?B?Um9iYiBHaWxtb3Jl?=
Guest
Posts: n/a
 
      9th Mar 2005
The server is not coded to be multi-threaded. It does not start any
additional threads. However from the reading I've done, and from what we are
observing, it appears that IIS runs all apps in multiple worker-threads. So
if 2 clients call this server at the same time, 2 threads are spawned by IIS
to handle the requests in parallel. Right now we are stopping this by
putting a giant lock{} arround the entire method called by the client. But
that requires a code change, of course. I'm looking for a way to tell IIS (
5 and 6 ) NOT to spawn more than 1 worker thread at a time, so that it is
always processing only 1 client request at a time.

thanks
Robb

"Cor Ligthert" wrote:

> Robb,
>
> How did you made it multithreaded?
>
> Cor
>
>
>

 
Reply With Quote
 
Joshua Flanagan
Guest
Posts: n/a
 
      10th Mar 2005
As an ugly hack (which it sounds like you are looking for), this might work:

Create a new assembly with a custom IHttpModule. Have the module handle
the BeginRequest method of the HTTP pipeline. Have it lock on a global
object of some sort (maybe an OS mutex? - look into the WaitHandle class
-I'm just guessing right now).

You can then distribute the new assembly and register the HttpModule in
the web.config file. That should allow you to provide the functionality
without modifying the code.



Robb Gilmore wrote:
> The server is not coded to be multi-threaded. It does not start any
> additional threads. However from the reading I've done, and from what we are
> observing, it appears that IIS runs all apps in multiple worker-threads. So
> if 2 clients call this server at the same time, 2 threads are spawned by IIS
> to handle the requests in parallel. Right now we are stopping this by
> putting a giant lock{} arround the entire method called by the client. But
> that requires a code change, of course. I'm looking for a way to tell IIS (
> 5 and 6 ) NOT to spawn more than 1 worker thread at a time, so that it is
> always processing only 1 client request at a time.
>
> thanks
> Robb
>
> "Cor Ligthert" wrote:
>
>
>>Robb,
>>
>>How did you made it multithreaded?
>>
>>Cor
>>
>>
>>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Single-threaded apartment? Dustin Davis Microsoft VB .NET 6 11th Jan 2007 11:54 PM
Redesign Outlook so it is not a single threaded application =?Utf-8?B?RENTSS0gU3RldmU=?= Microsoft Outlook Discussion 3 20th Jul 2006 06:44 AM
single-threaded gui Spyware Announcements 1 10th May 2005 07:36 PM
how to wait for object with single threaded application =?Utf-8?B?UGF1bA==?= Microsoft ASP .NET 6 10th Nov 2004 04:40 PM
Single-threaded vs. multi-threaded applications Opti_mystic Microsoft Windows 2000 Advanced Server 0 16th Oct 2003 08:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:28 PM.