[go: up one dir, main page]

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

Explore file-based locking #28

Closed
madelson opened this issue Dec 28, 2019 · 2 comments
Closed

Explore file-based locking #28

madelson opened this issue Dec 28, 2019 · 2 comments
Milestone

Comments

@madelson
Copy link
Owner

On linux, we can do blocking flock with this method (https://stackoverflow.com/questions/40710549/is-there-a-portable-way-to-put-a-timeout-on-flock) for cancellation.

On windows, we can use LockFileEx in async mode and possibly combine that with cancelioex to cancel the async io operation (not sure if this works). Also since we're doing async IO it's probably not the end of the world to just leave the async task running and have it unlock itself upon completion.

@madelson madelson added this to the 2.0 milestone Sep 29, 2020
@c0shea
Copy link
c0shea commented Sep 29, 2020

Fun with file locking

@madelson
Copy link
Owner Author
madelson commented Sep 29, 2020

@c0shea feel free to check out the new implementation here: https://github.com/madelson/DistributedLock/blob/release-2.0/DistributedLock.FileSystem/FileDistributedLock.cs#L66. It's a similar idea to what you've linked. If you're interested in trying this out I can publish a prerelease. Otherwise, this will come out with 2.0.

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

No branches or pull requests

2 participants