Subj : Re: A debugger/profiler not to interfere with threads ? To : comp.programming.threads From : Jason Curl Date : Fri Aug 12 2005 11:29 am Timothy Madden wrote: > 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. Hopefully this link might let you extend the time that it takes to shutdown Windows. http://support.microsoft.com/?kbid=146092&sd=RMVP http://www.microsoft.com/resources/documentation/Windows/2000/server/reskit/en-us/Default.asp?url=/resources/documentation/Windows/2000/server/reskit/en-us/regentry/26734.asp > > "Timohty Madden" > Romania .