什么是不同的CLR句柄类型? [英] What are the different CLR handle types?

查看:160
本文介绍了什么是不同的CLR句柄类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在观看Mario Hewardt的.NET内部和高级调试技巧中的Pluralsight课程,我已经看到了CLR中句柄的概念。

I've been watching Mario Hewardt's Pluralsight course on .NET Internals and Advanced Debugging Techniques and I've come across the concept of handles in the CLR.

现在我已经找到这个 awesome so answer 关于什么句柄,但是Mario指的是句柄类型:

Now I've already found this awesome SO answer about what a handle is, however Mario refers to the handle types:

  • Strong Handle
  • Pinned Handle
  • Async Pinned Handle (SO description)
  • Ref Count Handle
  • Weak Long Handle
  • Weak Short Handle
  • Other Handle

哪些不是我真的在视频中解释过,我认为那些参加这个课程的人是有希望的。

Which aren't really explained in the video and I assume are expected knowledge for those taking this course.

我做了一个Google,找不到令人满意的描述这些是,所以我希望一个SO用户可以帮助我。

I did a Google and couldn't really find a satisfactory description of what these are, so I was hoping an SO user could help me out.

推荐答案

我已经在我的笔记中找到了windbg:

I have found this in my notes for windbg:


  • #ESP - ESP =扩展堆栈指针,对象正在堆栈中使用(注意,!gcroot可能会返回误报在这里,阅读!帮助gcroot在windbg)

  • #ESP - ESP=Extended Stack Pointer, Object is in use on a stack (attention, !gcroot may return false positives here, read !help gcroot in windbg)

#DOMAIN(x):HANDLE(强) - 强引用,通常静态变量

#DOMAIN(x):HANDLE(Strong) - Strong reference, Typically a static variable

#DOMAIN(x):HANDLE(WeakLn) - 弱长处理,通过定稿跟踪的弱参考(可以复活)

#DOMAIN(x):HANDLE(WeakLn) - Weak Long Handle, A weak reference that is tracked through finalization (can be resurrected)

#DOMAIN(x):HANDLE(WeakSh) - 弱短句柄,弱参考,无法复活

#DOMAIN(x):HANDLE(WeakSh) - Weak Short Handle, A weak reference, can't be resurrected

#DOMAIN(x):HANDLE(固定) - 固定对象,固定在特定地址,在垃圾收集期间不能移动。

#DOMAIN(x):HANDLE(Pinned) - Pinned object, pinned at a specific address, can't move around during garbage collection.

#DOMAIN (x):HANDLE(RefCnt) - 参考计数,只要引用计数为> 0。

#DOMAIN(x):HANDLE(RefCnt) - Reference count, referenced as long as the reference count is > 0.

我早就把它拿走了f rom的一些MSDN博客我相信,它可能是苔丝',但我无法追踪正是在这一刻。 (BTW,如果你进入.net调试,你还不知道,想要使用windbg / sos / sosex,这是学习的地方)。

I've taken it long time ago from some MSDN blog I believe, it could have been Tess', but I can't trace it exactly at the moment. (BTW, if you're into .net debugging and you don't know it yet and want to use windbg/sos/sosex, this is the place to learn).

Alejandro Campos Magencio也有一系列精美的文章,用windbg和sos进行调试;在第3部分,您可以在那里找到大部分GC句柄类型的定义的一些确认。

Alejandro Campos Magencio has also a fine series of articles on debugging with windbg and sos; in part 3 you can find there some confirmations of definitions of most of GC Handle types.

这篇关于什么是不同的CLR句柄类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆