Solved

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

Posted on 2009-03-30
1
473 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

632 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