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 7546717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:16:17+00:00 2026-05-30T09:16:17+00:00

I find naming threads to be very useful when debugging. I can see no

  • 0

I find naming threads to be very useful when debugging.

I can see no way to name a thread using arguments to Task.Factory.StartNew()

So is it acceptable to name the thread explicitly in the task? eg:

private void MyFunc()
{
    Task.Factory.StartNew(() =>
    {
        Thread.CurrentThread.Name = "Foobulizer";
        Foobulize();
    });
}

However, I appreciate that threads may be reused for different tasks, so would I need to explicitly reset the thread name at the end of the task? This feels pretty hacky so I’m thinking this is probably a bad idea, or there’s a proper way to do it?

  • 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-05-30T09:16:18+00:00Added an answer on May 30, 2026 at 9:16 am

    You cannot do this since multiple Tasks can share the same or multiple threads depending on ThreadPool state in a given moment of time. Basically, Task is not a Thread. It’s just a high level abstraction for the asynchronous operation. You can use the Task.Id property, but keep in mind that Id is readonly and of int type, so you can’t assign custom user-friendly name.

    Task IDs are assigned on-demand and do not necessarily represent the
    order in the which Task instances were created

    Take a look at the built-in Visual Studio 2010 Parallel Debugging features. Perhaps you’ll find another approach: Walkthrough: Debugging a Parallel Application

    Parallel Tasks Window:

    enter image description here

    For each running Task, you can read its ID, which is returned by the
    same-named property, the ID and name of the thread that runs it, its
    location (hovering over that displays a tooltip that has the whole
    call stack). Also, under the Task column, you can see the method that
    was passed into the task; in other words, the starting point

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

Sidebar

Related Questions

Where can I find a detailed manual about PostgreSQL naming conventions? (table names vs.
For the life of me I can not find the Enterprise Library Strong Naming
I can't seem to find a reference for CodeIgniter's naming convention for interfaces. Is
where can I find the naming rules for Android resources? I found out thanks
find . -type f -print prints out ./file1 ./file2 ./file3 Any way to make
I find the concept of the programmable, tiling, keyboard-focuessed window manager ion3 very appealing,
I find I can do more with NHibernate, and even Castle than with the
I find myself writing delegates occasionally for really simple functions (take no arguments and
Possible Duplicate: Anyone else find naming classes and methods one of the most difficult
Please can you help me to find some tools which will help developers 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.