Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2009-03-30
1
Medium Priority
?
478 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Loops Section Overview

877 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