ArthurHub / ArthurHub/HTML-Renderer
using Dictionary for caching causes multi-thread issues.
- Vorherrschende Sprache
- C#
- Sterne
- 1.4k
- Forks
- 550
- Ø Merge
- 14 T. 9 Std.
- Gemergte PRs (30 T.)
- 1
Beschreibung
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.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp
- Bereich
- performance
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 42/100