emscripten-core / emscripten-core/emscripten

WasmFS: Use "readwrite-unsafe" in OPFS backend

Open
#21,869 0 comments 2 reactions 0 assignees View on GitHub
wasmfs
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

Currently the OPFS backend for WasmFS only uses SyncAccessHandles when files are opened for reading and writing. The reason we don't use SyncAccessHandles for read-only files is to support the use case of opening a file for reading from multiple tabs simultaneously; SyncAccessHandles acquire a file lock that allows a file to be opened by only a single agent at at time. However, there is a new "readwrite-unsafe" option that can be used with SyncAccessHandles that would allow them to be opened from multiple tabs. When this option is available, we should always use it no matter what mode the file is opened in.

https://developer.chrome.com/blog/new-dev-trial-for-multiple-readers-and-writers/

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.