473,542 Members | 2,846 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

List of running threads by name

3 New Member
I'm looking for a way to find a specific running thread by name. I came across the System.Diagnost ics.Process.Thr eads 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.AppDomai n. 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 10374
kenobewan
4,871 Recognized Expert Specialist
Try System.Diagnost ics.Process.Get CurrentProcess. Threads...

Hope that this helps.
Jan 16 '07 #2
hmoeller
3 New Member
I've come across that hook already. Unfortunately, this collection returns instances of type "ProcessThr ead" 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 Recognized Expert Specialist
Try System.Diagnost ics.Process.Get CurrentProcess( ).ProcessName; but just seen an opinion that the name of threads can't be obtained:
Grokking Active Threads
Jan 17 '07 #4
hmoeller
3 New Member
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 Recognized Expert Specialist
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
2620
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 position in the list. Is there a way that I can delete these items from the list based on their names? Thanks, Bart
3
4846
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: when the user select the employeeid in drop down list, it will fire the onchange event, and then look up database and show the employee name in the...
1
8967
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 worker thread that the UI thread's worker thread started?
1
1784
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, Alwin S.
4
821
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 to do this in vb.net. Does anybody have a piece of code that can help me? Thanks
1
4704
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 | grep P1 it shows me the list : P1, P1(this is first thread), P1(this is second thread) For the list displayed above pid will be same. How do I display...
0
1330
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 that I can output it to the event log. I can use the ThreadPool to get me the no of available threads and use Thread.CurrentThread to get details of...
6
1626
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 and connection to SQL server. I also have a preview feature.
1
1929
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
7576
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7723
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7326
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7673
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5874
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5250
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3383
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1803
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.