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

Is the treading.Lock really useful? #1

Open
ddanier opened this issue Sep 11, 2022 · 1 comment
Open

Is the treading.Lock really useful? #1

ddanier opened this issue Sep 11, 2022 · 1 comment

Comments

@ddanier
Copy link
Member

ddanier commented Sep 11, 2022

Currently we just copied what Django had. But I think we can remove the lock.

@skewty
Copy link

skewty commented Feb 1, 2024

Not really; you should be using asyncio.Lock instead. Yes, it is very useful and very important to prevent race conditions while updating state. Don't forget that every time you call await another async task can go change something after you already checked its value.. same race-condition issue as multi-threaded code and the reason for the lock.

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