Click here to Skip to main content
16,011,482 members
Home / Discussions / C#
   

C#

 
GeneralRe: Expression too complex Pin
leppie4-Jun-08 9:05
leppie4-Jun-08 9:05 
GeneralRe: Expression too complex Pin
joeyan3-Jun-08 22:27
joeyan3-Jun-08 22:27 
GeneralRe: Expression too complex Pin
PIEBALDconsult4-Jun-08 7:33
mvePIEBALDconsult4-Jun-08 7:33 
QuestionDynamaic GridView Issue Pin
GroCareer3-Jun-08 16:46
GroCareer3-Jun-08 16:46 
AnswerRe: Dynamaic GridView Issue Pin
Ashfield3-Jun-08 21:09
Ashfield3-Jun-08 21:09 
Questionthread ID Pin
George_George3-Jun-08 15:40
George_George3-Jun-08 15:40 
AnswerRe: thread ID Pin
Luc Pattyn3-Jun-08 16:46
sitebuilderLuc Pattyn3-Jun-08 16:46 
GeneralRe: thread ID Pin
George_George3-Jun-08 17:02
George_George3-Jun-08 17:02 
Thanks Luc,


1.

My application is pure C# application, and I want to dump thread ID to detect the behavior of each thread, so that I can find deadlock/re-entrance/how many times a thread enters a specific method, something like this.

After reading document, I am confused whether I can use ManagedThreadId property, my concern is for example, whether two threads will map to the same ManagedThreadId, so that the monitor is not accurate to serve my purpose.

2.

Luc Pattyn wrote:
As a consequence, there is simply NO WAY to identify your threads; not by name (Windows
does not know about thread names), and not easily by thread IDs, they are confusing
at the least.


Why not can not be identified by ManagedThreadId? Could you show me a scenario please? Smile | :)

3.

Luc Pattyn wrote:
What you can do is catch the managed thread ID when the thread gets created,
attach a thread name to it (using a Hashtable/Dictionary), then keep track of your
threads by asking them their ID, and look up the thread name you assigned earlier.
But that is a rather clumsy workaround for a lernel shortcoming.


I am confused why ManagedThreadId is not enough? Could you show me a scneario when just using ManagedThreadId is not enough please?


regards,
George
GeneralRe: thread ID Pin
anujarya_20013-Jun-08 18:19
anujarya_20013-Jun-08 18:19 
GeneralRe: thread ID Pin
George_George3-Jun-08 18:22
George_George3-Jun-08 18:22 
GeneralRe: thread ID Pin
anujarya_20013-Jun-08 18:48
anujarya_20013-Jun-08 18:48 
GeneralRe: thread ID Pin
George_George3-Jun-08 18:50
George_George3-Jun-08 18:50 
GeneralRe: thread ID Pin
Luc Pattyn3-Jun-08 23:38
sitebuilderLuc Pattyn3-Jun-08 23:38 
GeneralRe: thread ID Pin
George_George3-Jun-08 23:49
George_George3-Jun-08 23:49 
GeneralRe: thread ID Pin
Luc Pattyn4-Jun-08 0:07
sitebuilderLuc Pattyn4-Jun-08 0:07 
GeneralRe: thread ID Pin
George_George4-Jun-08 0:44
George_George4-Jun-08 0:44 
GeneralRe: thread ID Pin
Luc Pattyn4-Jun-08 0:52
sitebuilderLuc Pattyn4-Jun-08 0:52 
GeneralRe: thread ID Pin
George_George4-Jun-08 1:11
George_George4-Jun-08 1:11 
GeneralRe: thread ID Pin
Luc Pattyn4-Jun-08 1:47
sitebuilderLuc Pattyn4-Jun-08 1:47 
GeneralRe: thread ID Pin
George_George4-Jun-08 1:53
George_George4-Jun-08 1:53 
GeneralRe: thread ID Pin
Luc Pattyn4-Jun-08 2:04
sitebuilderLuc Pattyn4-Jun-08 2:04 
GeneralRe: thread ID Pin
George_George4-Jun-08 2:06
George_George4-Jun-08 2:06 
GeneralRe: thread ID Pin
George_George4-Jun-08 2:03
George_George4-Jun-08 2:03 
GeneralRe: thread ID Pin
Luc Pattyn4-Jun-08 2:07
sitebuilderLuc Pattyn4-Jun-08 2:07 
GeneralRe: thread ID Pin
George_George4-Jun-08 2:11
George_George4-Jun-08 2:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.