Solved

how to tell ifa spawned thread is running in asp.net c#

Posted on 2009-03-30
1
426 Views
Last Modified: 2012-05-06
I have an asp.net app that spawns a thread like this

      Thread ANEWTHREAD = new Thread(new ThreadStart(DoSomething));
        ANEWTHREAD.Start();

I want to check on another page if the thread is still running - how can I do that?
0
Comment
Question by:mugsey
1 Comment
 
LVL 9

Accepted Solution

by:
Deathrace earned 500 total points
Comment Utility
Interesting Question: Try whether this will help.
In page1.aspx( where thread is created)
Thread...IsAlive Property
true if this thread has been started and has not terminated normally or aborted; otherwise, false

in page2.aspx
check the session variable, if its true its executing else not.


Dim instance As Thread

Dim value As Boolean
 

value = instance.IsAlive

if(value)

 session("threadstate") = "Alive";

else

 session("threadstate") = "Dead";

Open in new window

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
crm development 2 35
Create XML 5 30
Asp.net mvc 5 5 15
Achieve json result 2 28
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now