-
Notifications
You must be signed in to change notification settings - Fork 8
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
How to query and add atomically? #42
Comments
There is a built in locking system on the cache that should prevent this. |
Someone needs to tell the cache that two separate operations are to be performed atomically. If you rely on the write lock on SQLite, this issue still remains, as the write lock will not trigger during the query operation (it is read-only), allowing two separate processes to both simultaneously create and try to add a non-existing resource... I'll see how I can work around it. |
@romanzenka FYI we're resuming this conversation here. |
I could not find an API which would do the following:
bfcquery
for resource Xbfcadd
XI am afraid that I will run into race condition if two processes both query, both get negative result, then they both add at once.
Is there a way to remove a possibility of such a race condition?
The text was updated successfully, but these errors were encountered: