Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8857375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:34:27+00:00 2026-06-14T14:34:27+00:00

Hello I’m new to multithreading and tasks in C# .net from only help I

  • 0

Hello I’m new to multithreading and tasks in C# .net from only help I have succeeded to start a new task taht can keep running inbackground using:

//if(tsk =NotRunning){
tsk = Task.Factory.StartNew(TheMethod);

It is working fine by now but now when its started am unable to stop it now, I have been searching over msdn and found out few method that seems to be doing the job like Dispose buy they are not doing it, so I want to know two things:

  • How can I check whether this task is already running? (it’s an MVC project and the task is initiate with the controller call …/Task/Start so I don’t want to keep starting another instance of the task everytime this URL is accessed I want only one instance of it throughout the application running in the background)

  • Second how do I stop it than, I tried the following but didn’t work:

    public void TaskClose()
    {
        tsk.Dispose();
        var st = tsk.Status.ToString();
    }
    

I know there may be few answers regarding it available on internet but they mostly using Lambda expression and I am not very rehearsed with them so kindly provide answer in other way, I will even appreciate of you can point the right method or property name that I can use to accomplish my result.

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:34:28+00:00Added an answer on June 14, 2026 at 2:34 pm

    You cannot stop TPL tasks. The proper way to handle this is to implement cancellation tokens.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello am new to array can someone help? i have array in array. how
hello I'm new to PHP programming and I migrated from ASP .net to PHP..
In Asp.net mvc3 razor I have: Ajax.ActionLink(Hello world, Hello, Say, new RouteValueDictionary(new { word
Hello I am new to WPF and i do have some experience in ASP.NET
hello im new to python and have been reading over the documentation and am
Hello.Am new to ios development.What have to do for NSOpenPanel to work in the
Hello I am new to MATLAB , I wanted to know how can I
I have the following Test: public class EqualityTest { String one = new String(Hello
Hello i have problem with putting logs using multithreading, my function loks like this
I have a C# .Net 3.5 application that sends a multicast Hello packet to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.