Open nairihar opened 3 years ago
This may make some sense, but what are the priorities of console.log and Atomics.wait, how do they work internally?
I think because the worker is blocked and the console.log
is an asynchronous API, you can use fs.writeFileSync(1, 'hello')
.
Version
v16.12.0
Platform
MacBook-Pro.local 20.6.0 Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:31 PDT 2021; root:xnu-7195.141.2~5/RELEASE_X86_64 x86_64
Subsystem
worker_threads
What steps will reproduce the bug?
Hi,
I'm trying to work with
worker_threads
I've those two files, I expect that my log
Worker_1, prep for editing!
should be visible in the terminal, but it's not.I'm wondering why the first log is visible but the second not.
How often does it reproduce? Is there a required condition?
always
What is the expected behavior?
I think I should see this log in terminal:
Worker_1, prep for editing!
What do you see instead?
I see only the first console.log, but the second one isn't there.
Additional information
It's the same for node v14the