473,404 Members | 2,114 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,404 software developers and data experts.

Problem with w3wp.exe when recycling

I have an asp.net application that stores two worker threads in the
application object like so

Application["ThreadName"] = thread;

These objects are persistent and continuously do polling and other
work. Unfortunately, when iis recycles a process the old process hangs
around even though it doesn't have any requests coming in. Is it
because of these threads I am storing in the application store. And is
there a way to configure the process to shutdown even if the threads
are running or is there an application event that notifies you of a
process shutdown?

Nov 19 '05 #1
5 2233
I am still curious about my question, but I think I partially solved my
problem. I had webgarden set to 2 processes, which I didn't want.

Nov 19 '05 #2
Background and worker threads won't keep an application alive - the OS
will forcibly terminate them if need be.

You can use the Application_End method in global.asax to watch for the
application shutting down, but it is not 100% reliable.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On 11 Feb 2005 10:48:24 -0800, je******@yahoo.com wrote:
I am still curious about my question, but I think I partially solved my
problem. I had webgarden set to 2 processes, which I didn't want.


Nov 19 '05 #3
your threads need to detect the shutdown (ThreadAbortException) and exit.
aslo in the Application onend, you should send a shutdown command to threda
(or kill them).

-- bruce (sqlwork.com)
<je******@yahoo.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
| I have an asp.net application that stores two worker threads in the
| application object like so
|
| Application["ThreadName"] = thread;
|
| These objects are persistent and continuously do polling and other
| work. Unfortunately, when iis recycles a process the old process hangs
| around even though it doesn't have any requests coming in. Is it
| because of these threads I am storing in the application store. And is
| there a way to configure the process to shutdown even if the threads
| are running or is there an application event that notifies you of a
| process shutdown?
|
Nov 19 '05 #4
Background threads will be terminated by the OS - they don't keep an
application alive.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 11 Feb 2005 12:58:29 -0800, "bruce barker"
<no***********@safeco.com> wrote:
your threads need to detect the shutdown (ThreadAbortException) and exit.
aslo in the Application onend, you should send a shutdown command to threda
(or kill them).

-- bruce (sqlwork.com)
<je******@yahoo.com> wrote in message
news:11**********************@l41g2000cwc.googleg roups.com...
| I have an asp.net application that stores two worker threads in the
| application object like so
|
| Application["ThreadName"] = thread;
|
| These objects are persistent and continuously do polling and other
| work. Unfortunately, when iis recycles a process the old process hangs
| around even though it doesn't have any requests coming in. Is it
| because of these threads I am storing in the application store. And is
| there a way to configure the process to shutdown even if the threads
| are running or is there an application event that notifies you of a
| process shutdown?
|


Nov 19 '05 #5

Scott Allen wrote:
Background threads will be terminated by the OS - they don't keep an
application alive.


Ok, I am already handling the threadabortshutdown and the
application_end event and stopping my threads in these cases. So, I
guess the answer is that a process will be recycled even if a
background thread is running as long as it is not serving an active
request. Thanks.

Nov 19 '05 #6

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

Similar topics

3
by: Ricky Chan | last post by:
I am using windows 2003. I have unchecked all options in IIS6 application pool, so I assume no worker process recycling will be performed whether any event occured. what will be happened when...
3
by: James Hunter Ross | last post by:
Friends, We are preparing for Beta release of a new ASP.NET project, but our initial in-house tests are not going well. We have had W3WP.exe (and aspnet_wp.exe) die, and we feel we can monitor...
5
by: John | last post by:
I've started to get session loss on many of my web apps, after only a few minutes (the session lifespan is supposed to be 60 minutes). It occurs in several apps (all on same server), and started...
0
by: Mark A. Ziesemer | last post by:
I've seen a few other postings that looked similar to this, but most appear to have died without any working solutions, and lacked any helpful level of information to see if they might be related. ...
5
by: LRK | last post by:
Earlier this week we set up a second application pool to be able to implement trusted connections between ASP.NET apps and a SQL Server database on a different server. The trusted connection is...
0
by: Rabbit | last post by:
Dear All, I have recently using ASP.net 2.0 to build web application with Crystal Report for .net, one of my typical coding to generate report on web page as follows: Dim rpt As New...
14
by: GaryDean | last post by:
The web.config in my asp.net application, running on Server2003, has this entry: <sessionState mode="InProc" timeout="40". In IIS the asp.net State Management timeout setting is 40 for my website....
2
by: violeta123 | last post by:
I am stuck! Please help It might be difficult to explain the problem via email, but I will try. I have a Win 2003 Enterprise server running with the only purpose of a membership web site...
6
by: Anand Saha | last post by:
Machine: 32 bit Intel Xeon 2.93 GHz, 16 CPUs, 32 GB RAM OS: Windows Server 2003 R2 Ent Edition, SP2 Web Server: IIS 6 ASP.NET ver: 2.0 I made a simple ASP.NET application, with only this code...
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:
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...
0
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...

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.