-
Notifications
You must be signed in to change notification settings - Fork 18
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
File locking #2
Comments
Any update on this? Is it going to be implemented ? |
The next step here is for someone to propose a specific feature set, so that we can evaluate whether it's sufficient for meaningful use cases, and whether it's implementable on popular platforms. As an aside, looking at the FreeBSD |
FreeBSD's I'm going to propose an API which is essentially |
Thanks @sunfishcode - looking forward to this. https://github.com/ziglang/zig/blob/2823fcabd1974550b889a56e8ada0eb52f3d2080/src/Cache.zig#L859-L886 Please share with me an early draft if you can and I will test-pilot the API. |
This is implemented by #69, right? |
Thanks for pointing that out - I hadn't noticed. |
#69 is now merged, and on track to be in preview2. This doesn't yet cover byte ranges or mandatory locking, but those can be considered separately. |
Sqlite and the Emscripten cache file are two cases where file locking has come up in real-world use cases.
The POSIX way to do file locking, with
fcntl
andF_SETLK
/F_GETLK
-style locks has the unfortunate property of being per-process, which is unfortunate both for being contrary to what applications actually want, and because we'd prefer to avoid exposing details like which host processes things are running in to wasm programs. (POSIX is considering fixing this, but until they do and systems update to the new mechanism, we need to work with what current systems provide.)Here are some notes on a WASI file locking API might want to consider:
fcntl
locks with the unfortunate POSIX behavior, andflock
with the desirable per-file-description behavior, howeverflock
only supports locking whole files at a time.The text was updated successfully, but these errors were encountered: