Debug two Thread Executions simultaneously.

  • Thread starter Thread starter Anil TG
  • Start date Start date
A

Anil TG

In my application im calling two threads to perform an update operation.Is
there any way to Monitor the two executions.i need to debug the executions
simultaneously,in two seperate debug windows..?..any hint?
 
In my application im calling two threads to perform an update
operation.Is
there any way to Monitor the two executions.i need to debug the
executions
simultaneously,in two seperate debug windows..?..any hint?

I don't have a running instance of VS handy at the moment, but it's my
recollection that you can suspend a specific thread to ensure that it
doesn't run as you step through a different thread. You can switch back
and forth between two threads this way to allow a sort of time-sliced
approach to debugging the threads.

I'm not aware of any way to actually view the state of two different
threads simultaneously. That doesn't mean it doesn't exist, but it's not
in an obvious place if it does.

Of course, the Express version of VS doesn't provide much in the way of
threaded debugging. For full control, you'll want to use a retail version
of VS.

Pete
 
I'v two threads.the main thread say thread A spawns the child Thread say
B.The first thread is provided with 100 ms of time to spwan and for the child
thread iv given 50 ms..they are not independent threads..so if i suspend my
parent thread "A" will it cause any problems to the child thread "B"?..
 
I'v two threads.the main thread say thread A spawns the child Thread say
B.The first thread is provided with 100 ms of time to spwan and for the
child
thread iv given 50 ms..they are not independent threads..so if i suspend
my
parent thread "A" will it cause any problems to the child thread "B"?..

I don't really understand any of that. First of all, in Windows there's
not really a parent/child relationship between threads. When you create a
new thread, it belongs to the process. Things that affect the runnability
of any other thread, including the thread used to create a given thread,
do not affect any other given thread.

Secondly, I don't know what you mean by "the first thread is provided with
100ms of time to spawn", nor the similar comment with respect to the
"child thread". Provided how? What does this time mean exactly? How is
it controlled? Threads don't normally come with an expiration date, so to
speak, so saying that they are "provided with" some amount of time doesn't
seem meaningful without some additonal context (context you haven't
provided here).

Pete
 
When you create ai think i'v got the answer to my question from the above statement..
The 100 ms that i mentioned is nuthing but the Thread.Sleep(100);..
Thnx Pete.. :-)

Regards
Anil TG
 
Back
Top