From 55fac9f5ead6d30996400e8597c969b675c5a22b Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Tue, 19 Dec 2023 18:07:22 +0530 Subject: fix(node): child_process IPC on Windows (#21597) 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) --- ext/node/polyfills/internal/child_process.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'ext/node/polyfills') diff --git a/ext/node/polyfills/internal/child_process.ts b/ext/node/polyfills/internal/child_process.ts index b9bf13396..0e93e22d3 100644 --- a/ext/node/polyfills/internal/child_process.ts +++ b/ext/node/polyfills/internal/child_process.ts @@ -45,7 +45,6 @@ import { getValidatedPath } from "ext:deno_node/internal/fs/utils.mjs"; import process from "node:process"; const core = globalThis.__bootstrap.core; -const ops = core.ops; export function mapValues( record: Readonly>, @@ -1069,9 +1068,7 @@ function toDenoArgs(args: string[]): string[] { return denoArgs; } -export function setupChannel(target, channel) { - const ipc = ops.op_node_ipc_pipe(channel); - +export function setupChannel(target, ipc) { async function readLoop() { try { while (true) { -- cgit v1.2.3