mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-01 07:33:12 +08:00
Give 6809's island and native timers room on a loaded host
6809-node-island-stdio armed a 5 ms island timer and a 10 ms native timer next to immediates. On a loaded host the main script can run past 5 ms after arming, so Node runs the island timer before the immediates and the output order depends on load. The timers are now 50 ms and 100 ms, well after the script and the immediates finish; the expected order is unchanged.
This commit is contained in:
@@ -10,12 +10,14 @@ process.stdout.write("native write 1\n");
|
||||
console.error("native error 1");
|
||||
callSync("./stdio.cjs", "big", 200000);
|
||||
process.stdout.write(`${"n".repeat(200000)}\n`);
|
||||
callSync("./stdio.cjs", "later", 5);
|
||||
// The island timer (50 ms) and the native timer (100 ms) are due well
|
||||
// after this script and the immediates finish, on a loaded host too.
|
||||
callSync("./stdio.cjs", "later", 50);
|
||||
setTimeout(() => {
|
||||
console.log("native timer log");
|
||||
callSync("./stdio.cjs", "write", "2");
|
||||
console.error("native timer error");
|
||||
}, 10);
|
||||
}, 100);
|
||||
setImmediate(() => console.log("native immediate log"));
|
||||
process.on("exit", () => console.log("native exit listener log"));
|
||||
console.log("native log 2");
|
||||
|
||||
Reference in New Issue
Block a user