-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement poll_oneoff
in WASI P1
#592
Comments
I want to take a look at this one soon |
I started looking at this a while ago, but it didn't seem possible to run the WASI testsuite tests due to them using stdin/stdout/stderr which are fundamentally blocking in our implementation as we use |
I found that various library functions in Python such as the |
pretty much. Also, stdin kinda wants to be treated differently, so in wazero we special case that. Basically I've been meaning to port over the logic here https://github.com/tetratelabs/wazero/blob/610c202ec48f3a7c729f2bf11707330127ab3689/imports/wasi_snapshot_preview1/poll.go#L98-L197 but you can get away with less than that for a lot of binaries; a lot of the nonblocking stuff is related to how the Go compiler (not tinygo) wants to treat I/O (it sets the nonblocking flag everywhere) |
Very likely, from what I've seen the Go and Zig code using it are fine with the timer part, just remember to throw meaningful exceptions in case is not so that we can eventually track other usages. |
That code is polling for data on stdin. We could do a sleep loop while calling |
that might work |
Zig, the Go standard library, Rust(in some cases) and c2w require
poll_oneoff
.It would be great to have a stable implementation of it.
Spike ref:
https://github.com/dylibso/chicory/pull/530/files#diff-9037d84891e8043e756bfd63e2101686b67d1cad2cc2c4af3b2e6b48675acdf3R1086
The text was updated successfully, but these errors were encountered: