473,320 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

List of running threads by name

I'm looking for a way to find a specific running thread by name. I came across the System.Diagnostics.Process.Threads collection but unfortunately, this collection holds ProcessThread objects which don't provide the thread's friendly name.

I expected to find something like that in System.AppDomain. But while there is a CurrentThread property, this class lacks any sort of collection for all running threads.

I am pretty sure that there's something like what I'm looking for. However, the debugger is able to display friendly names for each thread and so is e.g. CodeSite.

Does anybody know a hook within .NET 2.0 where to find a list of running threads with friendly names?
Jan 15 '07 #1
5 10329
kenobewan
4,871 Expert 4TB
Try System.Diagnostics.Process.GetCurrentProcess.Threa ds...

Hope that this helps.
Jan 16 '07 #2
I've come across that hook already. Unfortunately, this collection returns instances of type "ProcessThread" and this class doesn't hold the thread's name.

Maybe there's a way to obtain the friendly name for a ProcessThread instance?
Jan 16 '07 #3
kenobewan
4,871 Expert 4TB
Try System.Diagnostics.Process.GetCurrentProcess().Pro cessName; but just seen an opinion that the name of threads can't be obtained:
Grokking Active Threads
Jan 17 '07 #4
The referenced article states that there might not be a way to get friendly names for unmanaged threads. That doesn't matter to me since I just need a named list of managed threads for my own AppDomain.

The ProcessName is not really what I'm looking for, though.
Jan 22 '07 #5
kenobewan
4,871 Expert 4TB
Sorry that I couldn't help, but found 2 more articles that may be worth a look:
Using Diagnostic Classes In The .NET SDK
.NET Diagnostics - II, A Threads Monitoring Application Using C#
Jan 23 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Bart Nessux | last post by:
Hi, I am generating a list of file names... some of the files are locked by the OS (Windows XP) and I know the names of these files (NTUSER.DAT, ntuser.dat.LOG, etc.) But, I don't know their...
3
by: Matthew Louden | last post by:
if the user select the EmployeeID in drop down list, and then click the submit button, and it will look up database and show the Employee Name in the text box, this is easy. But my case is:...
1
by: John | last post by:
If my main UI thread starts a worker thread, who starts its own worker thread. So if i just close my app, in the closing event i can kill the thread the UI thread starts. but how can i kill the...
1
by: Al Sav | last post by:
Hello, I am trying to find the file location and file names of all the processes that I see in windows task manager. How can I list all the exes that are running currently? Thanks in advance,...
4
by: sneffe | last post by:
Hi, im writing a program to keep track of which programs is currently running. I would like to have the caption of running programs displayed in a textbox on my form. I cant seem to find an easy way...
1
ashitpro
by: ashitpro | last post by:
I've program(P1) that creates two threads say t1 and t2. t1 again spawns few threads, I want to know all threads working under P1(directly or indirectly), I also trued one command ps -eLF |...
0
by: PromisedOyster | last post by:
We are having issues with our application periodically hanging. I have a timer event already running and I would like to know the state of all the running threads (foreground and background) so...
6
by: garther | last post by:
Hi I'm writing an application which basically takes images from pixelink camera and does some calculations on them. I need to monitor the status of the system for 2 things: presence of camera...
1
by: Lagon666 | last post by:
Get running object name Hi Is it possible to get running object name using a command that defined in same object? <script> var test = function() {
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.