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

Dependency Handling and Initialization #6

Open
KevinAJohnson96 opened this issue May 25, 2024 · 2 comments
Open

Dependency Handling and Initialization #6

KevinAJohnson96 opened this issue May 25, 2024 · 2 comments

Comments

@KevinAJohnson96
Copy link

I noticed in db.py, there are conditional imports that are controlled by global variables and locks which may lead to race conditions. This may happen as threads enter locked sections and do not have the information on whether the necessary module is already imported by another unless it is reflected by the globals. If the checking of these globals is for some reason bypassed, two threads may end up importing the same module twice, leading to unnecessary operations. This could be avoided by importing these modules at the start of the program and global variables should not be modified unless the modification is handled through a thread-safe mechanism such as thread-local storage.

@shhossain
Copy link
Owner

I appreciate your insight into the implementation of the module. Initially, I did consider that there might be issues with how I handled imports, but due to time constraints, So, I just went with what seemed like a quick fix. If you have suggestions for improvement, I'd be glad to hear them. However, at the moment, I'm tied up with other commitments. Feel free to submit a pull request with any enhancements you think would benefit the project. Thanks for your understanding.

@KevinAJohnson96
Copy link
Author

Thank you for your response. I would very much like to submit a pull request, but I do have the necessary permissions to push to the repo. Could you grant me collaborator access?

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