ThreadId = 1436534
If you use the thread identifier (ThreadId) as your filter condition, you will need to be in debug mode and examine the current identifier for each of your threads. These values are not guaranteed to be consistent from one run to another.By far, the easiest way to set thread specific breakpoints is for your threads to be named. By naming each thread, filtering becomes simple and portable (thread names do not change from run-to-run and system-to-system like thread IDs do). There are a few easy ways to name your managed threads:
Thread.CurrentThread.Name = "UserInterfaceThread";
for(int i = 0; i < this.maxThreads; i++){ Thread worker = new Thread(new ThreadStart(Worker)); worker.Name = String.Format("WorkerThread{0}", i); worker.Start();}
By naming your main application thread (ex: "MainAppThread"), and creating a breakpoint with the filter set to ThreadName != "MainAppThread", the debugger will alert you whenever the code is hit by one of the worker threads. The table below shows how the Threads window may look when the breakpoint is hit.
ThreadName != "MainAppThread"
>
Take care,-- DK[Edit: table formatting]This posting is provided "AS IS" with no warranties, and confers no rights. Some of the information contained within this post may be in relation to beta software. Any and all details are subject to change.