Subj : Re: A debugger/profiler not to interfere with threads ? To : comp.programming.threads From : Jason Curl Date : Thu Aug 11 2005 04:18 pm Timothy Madden wrote: > Hy > > I have a thread syncronization problem in my application (a WinNT > service, I have Win2000 5.00.2159 SP4, Visual C++ 6.0 SP6). > > The problem is at shutdown application hangs until Windows service > control manager terminates it (I guess). > > With the service executable under the debugger (WinDbg 6.5.0003.7) every > thing works just fine and the service shuts down nice and clean. > > I have some complicated thread syncronisation sequences in my code. I > have written a buffer to support read access, write access, memory > allocation and memory deallocation all on different threads. I did in in > the hope to make it a little more responsive and fast, although I don't > know if I succeded. > > 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. It's not really an answer to your question, but it might help. > > Thank you > "Timothy Madden" > Romania .