Dispatcher Name not appearing in Threads window
-
Wednesday, April 11, 2012 1:25 AMModerator
Hi All,
I am having problems with CCR dispatcher name not appearing for its threads in Visual Studio->Debug->Windows->Threads window. This occurs when I create the Dispatcher use the parameterless Dispatcher() constructor (without passing the name of the dispatcher) and then later set the Name property. If I use any of the non-parameterless Dispatcher() constructor that explicitly takes the name of the dispatcher, it works correctly. Please find a sample code below.
The following has the name of all the threads appear correctly as "MyThreadPool" in the Threads window
Dispatcher dispatcher = new Dispatcher(4, "MyThreadPool");
The following has the name of all the threads appear as "<No Name>" in the Threads window
Dispatcher dispatcher = new Dispatcher(); dispatcher.Name = "MyThreadPool";
Please help.
Thanks,
Venkat
All Replies
-
Wednesday, April 11, 2012 6:46 PMModerator
Good find, this appears to be a “feature” J
Looking at the source I can clearly see that the Dispatcher constructor immediately adds threadCount workers; assigning the given threadPoolName. However, the Name property setter has no effect on the existing workers thereafter. The Name property really should be readonly.
- Proposed As Answer by Ashley Nathan FenielloMicrosoft Employee, Moderator Wednesday, April 11, 2012 6:47 PM
- Marked As Answer by Venk KModerator Wednesday, April 11, 2012 8:25 PM
-
Wednesday, April 11, 2012 8:26 PMModeratorThanks Ashley Feniello for the clarification.

