Skip to content

Feature/tls dfti cache #44

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

Merged
merged 2 commits into from
Oct 24, 2019
Merged

Feature/tls dfti cache #44

merged 2 commits into from
Oct 24, 2019

Conversation

oleksandr-pavlyk
Copy link
Contributor

This PR replaces use of global variable used to cache dfti descriptor (and required use of threading.Lock() to protect it from corruption in multi-threaded use) with use of thread local storage.

Consequentially, this removes the need to use atexit to register cache destructor. Use of DftiFreeDescriptor in the function registered with atexit may cause a crash (like it did on Windows), since the library can not be guaranteed to still be loaded.

Replaced use of global variable to store cached DFTI descriptor in favor of
using Thread Local Storage to store it.
Since DftiCache is allocated in thread local storage, use of Lock() is not longer needed.
@oleksandr-pavlyk
Copy link
Contributor Author

@aguzmanballen
Copy link

Wow, that's a lot of changes. Well I don't see anything nasty in there, and the CI passed. I imagine you also did some testing so assuming that you didn't encounter any issues, this should be good to merge. 👍

@oleksandr-pavlyk oleksandr-pavlyk merged commit aeb56b7 into master Oct 24, 2019
@oleksandr-pavlyk oleksandr-pavlyk deleted the feature/tls-dfti-cache branch December 7, 2022 18:13
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

Successfully merging this pull request may close these issues.

3 participants