473,795 Members | 2,967 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2005
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
4624
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 an end-user in an organization and the database, through the exclusive use of stored procedures which are authored by the organization or by software developers. All development work at the application software level may thereby be conducted...
3
1311
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 reached. I looked at the performance data and here is what I found: ASP.NET Requests Total : 28462 (Keeps increasing) ASP.NET Requests/Sec: 2 (5 in peak hours) Gen 0 Collections : 157 (This is really bizzare that after more that 28K
5
6483
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 Crystal Report to PDF and it works quite nicely using the Response.ContentType = "application/pdf". However, the users have an option to include other documents/reports in their report that are associated with the report. For example: User previews a...
5
2971
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 use the DB2 Governor to do this, but it seems it always allows the the first query to be processed before forcing the connection. Here is my db2gov config file: --- start config
0
2748
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 CLR. The application runs on ..NET 1.1 SP1. When the deadlock happens the process is using 0 CPU. I was able to collect crash dumps and have been trying to make sense out of them using windbg.
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10436
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3722
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.