本文介绍了从Finalization Queue转换到FReachable Queue .net垃圾收集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

感谢Jeffrey的精彩之作,



垃圾回收器扫描结束队列,寻找指向这些对象的指针。找到一个指针,指针从最终化队列中移除并附加到可freachable队列(发音为F-reachable)。



从上面的对象J ,我,E从Finalization Queue移到fReachable Queue。



我不清楚Finalization Queue到fReachable Queue的转换。



队列的FIFO逻辑怎么样。如何在没有离队F的情况下完成对象E的出队?



无论是Finalization Queue还是Finalization列表?



请稍等。

$尽管在最终确定队列和可排队队列这两个短语中使用了队列这个词,但是我们不应该对其中的顺序做出任何假设应该处理这些集合中的对象。我认为可最终名单一词会更具描述性;我认为将它称为队列的唯一原因是,如果垃圾收集器在识别大对象后启动新的终止队列,然后访问其中的每个条目;然后将每个条目丢弃(如果终结器已被抑制),将其添加到新的终止队列(如果该对象已被标记为保留)或添加到可扩展队列(如果该对象尚未被保留标记)。

Thanks to Jeffrey for the fantastic one, http://msdn.microsoft.com/en-us/magazine/bb985010.aspx

"The garbage collector scans the finalization queue looking for pointers to these objects. When a pointer is found, the pointer is removed from the finalization queue and appended to the freachable queue (pronounced "F-reachable")."

From the above the objects J,I,E are moved from Finalization Queue to fReachable Queue.

Im not clear about the transition of Finalization Queue to fReachable Queue.

What about the FIFO logic of Queue. How dequeue of object E done without dequeuing F?

Whether it is a Finalization Queue or Finalization list?

Kindly shed some light.

解决方案

Despite the word "queue" in the phrases "finalization queue" and "freachable queue", one should not make any assumptions about the sequence in which objects in those collections should be processed. I would think the term "finalizable list" would be more descriptive; the only reason I can think of for calling it a "queue" would be if the garbage collector, after identifying large objects, starts a new finalization queue and then visits each entry in the one one; each entry then gets discarded (if the finalizer has been suppressed), added to the new finalization queue (if the object had been tagged for retention), or added to the freachable queue (if the object had not yet been tagged for retention).

这篇关于从Finalization Queue转换到FReachable Queue .net垃圾收集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 15:12