Open yowl opened 1 year ago
Another option
pthread_mutex_lock
with a noopWhat does the Browser build do, and how much shimming is needed to make this work?
It seems like there are two options, broadly:
1) Implement PAL-level functions and constructs for a single-threaded environment.
2) Shim pthread
APIs for a single-threaded environment - logically copy what Emscripten does.
pthread
is lower-level than PAL so it is in some sense easier to shim it, but if all of it needs shimming, that becomes less attractive.
Emscripten stubs it. It starts here with the PTHREADS
option setting is_mt
In the same file, this brings in the stubs
Where __pthread_mutex_timedlock
is stubbed
I will see how many of these we would need.
Fixed in #2317.
I've been regretting my decision to use pthreads in WASI, so was looking again at going to the non-pthreads configuration of the Wasi-SDK.
What would be a good approach to deal with things like
https://github.com/dotnet/runtimelab/blob/588b1e37a5caeefd187bc8ddc2e4735c3da2c183/src/coreclr/nativeaot/Runtime/unix/PalRedhawkUnix.cpp#L219
It uses
pthread_mutex_lock
so is a problem.Any thoughts on these options:
Thanks,
cc @dotnet/nativeaot-llvm