multithreading - How to tell if thread is running by its ID with C# -


i'm not sure if such possible in managed code. let me explain. need know particular thread running within process id. can thread in same process?

i suppose id mean managed id. short answer there no straight way enumerate managed threads in process. different process can use managed debugging api (mdbg) attach target process , enumerate managed threads debugger perspective. if can launch separate process it, easiest way. if have same process, possible. need mdbg source code. newest mdbg supports attaching dump file. need implement own icordebugdatatarget support live process. can access process same process same way attaching dump file using mdbg. there limitation analyzing dump file not same analyzing live process. satisfy need - enumerate managed thread id in process.

but said, if it's possible spawn short lived process job, easiest.

you can download mdbg source code , sample here.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -