Solved

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

Posted on 2009-03-30
1
449 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
ID: 24020361
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

809 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