NEW 283959
Support readwrite-unsafe mode for createSyncAccessHandle()
https://bugs.webkit.org/show_bug.cgi?id=283959
Summary Support readwrite-unsafe mode for createSyncAccessHandle()
Brandon Payton
Reported 2024-12-02 21:02:47 PST
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
Radar WebKit Bug Importer
Comment 1 2024-12-09 21:03:14 PST
Note You need to log in before you can comment on or make changes to this bug.