Chris
Tue Mar 27 16:57:29 CDT 2007
The definition of CLR threads in the leaves room for exactly what you
describe, but today's reality is that a CLR thread & an O/S thread are the
same thing in all current implementations of the CLR. As a result, you don't
have to worry about the details of CLR threads mapped to O/S threads. I
recently confirmed this by talking to both Joe Duffy & Jeff Richter. I
talked a bit about this in this thread:
http://groups.google.com/group/microsoft.public.dotnet.framework/tree/browse_frm/thread/c37841cfe5a1dd01/cc648b16583c6fa4
Also, WinDbg, when you use Son of Strike with it, gives you all the
debugging information you need. It's loaded with stuff. When you say,
"!threads", you get a list of CLR threads, and their details.
Using WinDbg & SOS, you should be able to track this down pretty easily.
--
Chris Mullins, MCSD.NET, MCPD:Enterprise, Microsoft C# MVP
http://www.coversant.com/blogs/cmullins
"Zachary Turner" <divisortheory@gmail.com> wrote in message
news:1175030088.811425.28890@o5g2000hsb.googlegroups.com...
> I'm familar with WinDbg already, but it only operates on primitive
> windows threads. My understanding of .NET Threads is that there is no
> defined mapping between a .NET Thread and the Windows thread(s) by
> which it is implemented. In fact, 4 different .NET Threads may be
> implemented on a single windows thread, or 1 different .NET Thread may
> be implemented by 4 Windows threads. I may be wrong about that, but I
> never considered the WinDbg option simply because even if I found out
> which Windows thread was holding the object, I wouldn't be able to map
> that back to one of my .NET threads.
>
> On Mar 27, 3:51 pm, "Chris Mullins [MVP]" <cmull...@yahoo.com> wrote:
>> "Zachary Turner" <divisorthe...@gmail.com> wrote
>>
>> > Is there some sort of debugger command that will tell me which thread
>> > is holding the lock on this object?
>>
>> There sure is. Unfortunatly, it only exists in WinDbg & Son of Strike -
>> not
>> in Visual
>> Studio.
http://msdn.microsoft.com/msdnmag/issues/05/07/Debugging/?topics=/msd...
>>
>> You should be able to track it down pretty quickly, once you get over the
>> "eeewwww!" factor that comes with WinDbg.
>>
>> Generating a dump one your application is hung is pretty easy. You can
>> read
>> about it either in the article I already linked, or
>> at:
http://www.coversant.net/Coversant/Blogs/tabid/88/EntryID/28/Default....
>>
>> (If you're able to consistanly get your app to deadlock, you should be
>> able
>> to skip the whole 'Create a Dump" step, and just run your app using
>> WinDbg &
>> SOS. That makes things a bit easier.)
>>
>> --
>> Chris Mullins, MCSD.NET, MCPD:Enterprise, Microsoft C#
>> MVP
http://www.coversant.com/blogs/cmullins
>
>