Subj : Re: A debugger/profiler not to interfere with threads ? To : comp.programming.threads From : Timothy Madden Date : Thu Aug 11 2005 08:09 pm Jason Curl wrote: > Timothy Madden wrote: [...] >> >> I suspect my service enters some deadlock at shutdown but in the >> debugger thread dinamics is of course radicaly changed and then by >> chance everythig seems to work fine. >> >> Do you know of any profiler or debugger that could monitor all >> sincronization operations on my threads in such a way that the debuged >> service runs at exactly the same speed and receives the same >> timeslices in each thread so that I can reproduce the problem. Perhaps >> on a multiprocessor that could run my service on one CPU and the >> debugger/profiler on the others. > > > One suggestion is to "print" to a console on shutdown. The site > www.sysinternals.com has some interesting articles about how to do this. > And then narrow down to where the problem is there by how your program > reacts. > > Alternatively, you might be able to shutdown your service, and when you > think it has "hung", attach a debugger to that process and find out where. > [...] Thank you for your response. I did something similar, i. e. I have written in a log file all syncronisation operations. Usualy this to could have also changed time division betwwen threads and so could have hidden back my bug, but this time I was lucky. Finaly I found out I had an auto-reset event where I should have had a manual-reset one. I still wonder how could it possibly ever have worked under the debugger, 'cause it sure had. And by the way, it happens that a service is not allowed to hang upon shutdown and stay hung, Windows will terminate the host process after a limited time. And this happens also if the process has a debugger attached to it. "Timohty Madden" Romania .