-
Notifications
You must be signed in to change notification settings - Fork 23
File locking #2
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
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. 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. |
Was this released as part of preview2? I'm not able to find it in the |
Unfortunately, file locking was removed around the time of preview2's release in order to keep the scope down, as there were a lot of other things to do to get preview2 released. Now that preview2 is released and the release cadence is established, we could re-introduce it. So I'll re-open this issue to track that. |
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: