473,386 Members | 1,796 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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
Jul 21 '05 #1
3 1978
Robb,

How did you made it multithreaded?

Cor
Jul 21 '05 #2
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

Jul 21 '05 #3
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

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: mountain man | last post by:
Greetings to all database professionals and laymen, Let us make a bold assumption that we have developed a software tool for the SQL Server environment which simply acts as an interface between...
3
by: Sherif ElMetainy | last post by:
Hello I have an ASP.NET application that just keeps leaking memory. The memory used by the application just keeps growing until the ASP.NET worker process is recycled when the memory limit is...
5
by: David Lozzi | last post by:
Hello, this is a repost of a previous post of mine from today. I need to export multiple documents (doc, xls, ppt, jpg) and crystal reports to a single PDF file. I know how to export a single...
5
by: toddles666 | last post by:
Hi- Is there any way of restricting access to a database by application & account? For example, I only want the application APP1 to access the database using the USER1 account. I've tried to...
0
by: Gordon Cone | last post by:
I am currently debugging a deadlock in a multithread C# application. It makes lots of calls to legacy unmanaged code. The application runs on windows sever 2003 and uses the sever version of the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.