ArthurHub / ArthurHub/HTML-Renderer

using Dictionary for caching causes multi-thread issues.

未关闭
#63 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
bug PDF
主要语言
C#
星标
1.4k
派生
550
平均合并
14 天 9 小时
30 天内合并 PR
1

描述

In RAdapter and FontsHandler, Dictionaries are used to cached brushes, pens and fonts.

Single instance pattern is used by PdfSharpAdapter, and this instance is used by all HtmlContainers generated during system running time.

It causes problem when using this single instance in a multi-thread environment. [Refer Here](http://stackoverflow.com/questions/1920864/when-does-a-dictionary-throw-an-indexoutofrangeexception-on-add-or-containskey)

Please replace Dictionary with ConcurrentDictionary.

贡献指南

这个仓库没有索引到贡献指南

调研方向

Locate RAdapter and FontsHandler, then inspect the dictionaries caching brushes, pens, and fonts. Review how the shared PdfSharpAdapter instance is used by multiple HtmlContainers and replace the affected dictionaries with concurrent collections. Done means the caches can be used safely in the described multi-threaded environment.

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp
领域
performance
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
描述清楚
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。