-
Notifications
You must be signed in to change notification settings - Fork 228
Open
Description
Update :
MR #700 by Alex answered most of these questions and contains a link to my initial implementation for stdout, file read, tcp, and poll.
Dear all,
to enable the use of cooperative threads from C++ we need a wasip3 implementation of files and sockets. I have some initial bits and pieces working together and would like to discuss a way to upstream these.
My thoughts and questions are roughly:
- A wasip3 compiler target isn't necessary for this as all WASI calls happen from within libc. The available
wasm32-wasip2target can already handle this with a custom sysroot. Do we need a wasip3 compiler target? And does a non-cooperative-threaded libc target for p3 make any sense? - Using the classical Makefile doesn't make much sense with CMake ready in Migrate the
Makefileto CMake #685 , but CMake uses the target triple to deduct the WASI variable (perhapsCMakefile.txtshould be changed to not override WASI from the target triple?) My working example specifies WASI=p3 on the make command line. How should this work with cmake? - I fully separated the names for p3 (
wall_clock3_datetime_t) from the names for p2 (wall_clock_datetime_t) by binding renames to detect remaining uses of the wrong symbols. I see both upsides and downsides to having a disjunct set of symbols betweenwasip2.handwasip3.h. Any thoughts? - Converting the blocking C API to using asynchronous p3 calls together with
waitable-set.waitcalls works just fine for my purpose. But perhaps the p3 (stream) handles could enable uses outside of libc, e.g. via__get_osfhandle. - I understood that @TartanLlama is currently working on the threading infrastructure for p3, so there should be little overlap between our work, but having a common compilation target in place simplifies cooperation. This is what this aims for, I will prepare a PR but would like to avoid unnecessary re-work by discussing here first.
Metadata
Metadata
Assignees
Labels
No labels