A web worker is part of the browser not JavaScript. They are the browser program running outside of JavaScript. JavaScript just can access this process of the browser. Again you can't control it and as far as processes, you can't have them communicate with each other. It's apart of whenever your code runs, not a process in JavaScript that channels data between processes. It's a browser feature and not even across most browsers and they even say not to even use it.
Stop calling JavaScript multithreaded or parallel cause it's not!
To clarify, I'm talking about Node.js's worker_threads module, not web workers in the browser.
My understanding is that you have the ability to control multiple threads within the same process using worker_threads, and share memory between these threads. Is this inaccurate?
-1
u/[deleted] May 02 '20
A web worker is part of the browser not JavaScript. They are the browser program running outside of JavaScript. JavaScript just can access this process of the browser. Again you can't control it and as far as processes, you can't have them communicate with each other. It's apart of whenever your code runs, not a process in JavaScript that channels data between processes. It's a browser feature and not even across most browsers and they even say not to even use it.
Stop calling JavaScript multithreaded or parallel cause it's not!