English 中文(简体)
什么是“Async Pined Handle”?
原标题:What is an "Async Pinned Handle"?

我试图调查一个真正新生的软件坠毁事件,这有可能与管理得失的腐败有关(因为在垃圾收集过程中发生)。 利用WinDbg和SOS !gchandles的指挥,我获得一些东西。

0:000> !gchandles
GC Handle Statistics:
Strong Handles: 259
Pinned Handles: 137
Async Pinned Handles: 1
Ref Count Handles: 79
Weak Long Handles: 197
Weak Short Handles: 650
Other Handles: 0
Statistics:

And I m just curious, what is the difference between a "normal" pinned handle and an "async pinned" one? And can I find which one of my handles is the "async" one? I couldn t find any information on the net about it and since it seems that the application always crashes when this counter is exactly one it might be relevant to the crash. But then again it might just be some internal stuff used during the garbage collection..

最佳回答

Async pinned handles are strongly correlated with overlapped I/O in Windows. Which supports asynchronous reading and writing with ReadFile and WriteFile, using the OVERLAPPED argument. The device driver stores the passed buffer pointer and directly reads/writes from/to the buffer, entirely asynchronously from the program s operation. The managed wrapper methods are BeginRead and BeginWrite.

If the buffer is allocated in the GC heap then it needs to be pinned until the driver finishes using the buffer. Having the GC move the buffer while the driver is working on the I/O transfers is disastrous, writes would produce junk and reads would corrupt the GC heap, pinning is required to prevent the buffer from being moved while the driver is using it.

沥青的物体相对而言是多余的,它们给停车场收集器一个难以在铺设的路面的岩石上工作的时间。 在这里,一个必要的邪恶,唯一的可能途径是将缓冲带离尽可能短的时间。

捆绑式处理器有特殊标记,使《刑法》能够自动在I/O完成后确定缓冲。 当I/O完成港口信号完成后,因此不必等待客户代码执行回击和避开缓冲。 当飞行中有许多校对池塘时,可以做些什么。 这是一种微观创新,在你拥有一个网络服务器处理数以万计的客户要求时,往往转向宏观。

它只用于类型系统的物体。 过期 数据是CLR具有特别知识并且是用于Windows api功能的本土监督LAPPED结构管理的传真器。

简言之,你真的知道,如果你在1次处理故障时看到处理量,则I/O会发生重叠。 没有任何土著法典将I/O与分配的缓冲器相重叠,而没有掩饰,这确实是摧毁肥皂的好办法。 你们有太多的 handle。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签