Solved

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

Posted on 2009-03-30
1
467 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.

751 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