Bug 283959
Summary: | Support readwrite-unsafe mode for createSyncAccessHandle() | ||
---|---|---|---|
Product: | WebKit | Reporter: | Brandon Payton <brandon> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | cdumez, karlcow, sihui_liu, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Brandon Payton
WebKit does not support a way to concurrently access OPFS files. Could support be added for this? Chromium supports a `readwrite-unsafe` mode argument to createSyncAccessHandle() that permits concurrent access, and we are interested in using that feature with WebKit as well.
This is relevant to the development of WordPress Playground* which runs entire WordPress instances in the browser using WebAssembly builds of PHP and libsqlite3. (I am one of the maintainers who works on the project full-time.)
Web app: https://playground.wordpress.net
GitHub repo: https://github.com/WordPress/wordpress-playground
In today's Safari, WordPress Playground is limited to using a single web worker to service PHP requests because it is not possible to store a sqlite DB file in OPFS and access it simultaneously from multiple workers. We are interested in using sync file access handles in `readwrite-unsafe` mode to enable concurrent DB access.
There may be other ways of achieving this through the use of SharedArrayBuffer, but it would require syncing the buffer changes to OPFS and maintaining a copy of the entire WordPress database in memory.
If FileSystemSyncAccessHandle supported a "readwrite-unsafe" mode, the WordPress Playground and SQLite projects would have an opportunity to natively implement concurrent access to SQLite databases stored in OPFS.
Would you consider adding support for a FileSystemSyncAccessHandle "readwrite-unsafe" mode?
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/141197830>