Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not thread safe, is crashing in the Dictionary.Add #12

Open
rromerik opened this issue Jan 31, 2023 · 2 comments
Open

not thread safe, is crashing in the Dictionary.Add #12

rromerik opened this issue Jan 31, 2023 · 2 comments

Comments

@rromerik
Copy link

I had some crash in this file, when I load two file in parallel, betting a null ptr exception in the dictionary.add every variables are valid, I guess the dictionary is resizing while we are adding.

not sure if ThreadStaticAttribute or ConcurrentDictionary will be the best fix for this!

@SpocWeb
Copy link

SpocWeb commented Feb 1, 2023

ConcurrentDictionary would be the way to go, but it blocks. With ThreadStaticAttribute you create a separate Dictionary in each Thread which is Overhead and probably not what you want

@rromerik
Copy link
Author

rromerik commented Feb 1, 2023

an other option will be to lets the user change/set the default cache dictionary if we want to!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants