Object cache for C#

前端 未结 9 1447
面向向阳花
面向向阳花 2020-12-07 23:06

I\'m doing a document viewer for some document format. To make it easier, let\'s say this is a PDF viewer, a Desktop application. One requirement for the s

9条回答
  •  忘掉有多难
    2020-12-08 00:00

    The .NET Framework has always had the ability to keep weak references to objects.

    Basically, weak references are references to objects that the runtime considers "unimportant" and that may be removed by a garbage collection run at any point in time. This can be used, for example, to cache things, but you'd have no control over what gets colected and what not.

    On the other hand, it's very simple to use and it may just be what you need.

    Dave

提交回复
热议问题