Skip to content
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

fix(node): child_process IPC on Windows #21597

Merged
merged 13 commits into from
Dec 19, 2023
Merged

Conversation

littledivy
Copy link
Member

@littledivy littledivy commented Dec 15, 2023

This PR implements the child_process IPC pipe between parent and child. The implementation uses Windows named pipes created by parent and passes the inheritable file handle to the child.

I've also replace parts of the initial implementation which passed the raw parent fd to JS with resource ids instead. This way no file handle is exposed to the JS land (both parent and child).

IpcJsonStreamResource can stream upto 800MB/s of JSON data on Win 11 AMD Ryzen 7 16GB (without memchr vectorization)

@littledivy littledivy changed the title fix(node): support child_process IPC on Windows fix(node): child_process IPC on Windows Dec 15, 2023
@littledivy littledivy marked this pull request as ready for review December 16, 2023 05:55
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice work!

cli/args/mod.rs Show resolved Hide resolved
ext/node/ops/ipc.rs Outdated Show resolved Hide resolved
runtime/ops/process.rs Outdated Show resolved Hide resolved
@littledivy littledivy enabled auto-merge (squash) December 16, 2023 17:30
@littledivy littledivy merged commit 55fac9f into denoland:main Dec 19, 2023
13 checks passed
@bartlomieju bartlomieju deleted the windows_ipc branch December 19, 2023 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants