Skip to content

Explore file-based locking #28

Closed
Closed

Description

@madelson

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.

Activity

  1. added this to the 2.0 milestone on Sep 29, 2020
  2. c0shea commented on Sep 29, 2020

    @c0shea
  3. madelson commented on Sep 29, 2020

    @madelson
    OwnerAuthor

    @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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions