-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Add support for pipe syscall (PIPEFS) #4378
Conversation
An overview might help here - what does this do, in the big picture? |
This is needed to get boost/asio to work with emscripten. See issue #2883. Every call to the pipe syscall will basically create a new fifo buffer which users can write and read to. That's actually it. Asio uses this mechanism to interrupt an event loop. Yeah, I know this sound paradox as the browser is itself event-driven, this means that the user who wants to use asio has to integrate asio's event loop into the browser's one by calling the poll_one function. |
Ok, thanks. |
}); | ||
wNode.stream = writableStream; | ||
|
||
return [ readableStream.fd, writableStream.fd ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may as well return an object here, so you don't need to use 0 and 1 to index, but can use proper names.
What's the status of a test for this? |
Addressed all comments. A test will follow soon as I am currently heavily testing asio. |
Thanks, looks good so far. Waiting on the test, as it'll help me understand this more completely. |
Will this get correctly dead code eliminated away if one doesn't call |
Sorry about the delay, I was kinda busy these days. I will try to write some basic tests now. @juj Do you mean we should put this behind an |
I think it should be ok: |
Yeah, no need to have |
👍 would appreciate a merge |
Is this PR still planned for merge? It would be great to have the |
Looks like this PR is waiting on tests - we can't merge it without that. Also it needs to be rebased. |
I am not familiar with Emscripten FS layer, but in case you consider this implementation looking good enough, then maybe I can somehow help you with unit-testing it according to the |
I have rebased the branch but unfortunately I am currently unable to write tests because I simply don't have the time to setup the environment as I am very busy right now with other things. However, it would be great if someone else could write some tests for this patch. I would really appreciate this :). |
Thank you, @cynecx. How can I contribute tests? Should this PR be integrated first into some feature branch of |
I think the simplest thing is for you to create a branch in your repo, then merge in @cynecx's branch, then add the tests, then make a PR with all that together. |
This PR can probably be closed because it was integrated in #4935. |
Thanks! Closing. |
Addressing #2883.