-
Notifications
You must be signed in to change notification settings - Fork 312
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
Clear up Concurrency wording incorrect usage #512
Comments
The only operations that run concurrently in node are IO operations. You also cannot control the IO without special configuration. Example certain IO APIs outside ecma may use libuv which may or not perform the action the operation concurrent/spawn thread pools etc. |
concurrent seems to be correct usage Although node runs single threaded here (deno, with less expensive concurrency, may change that, once puppeteer is supported: denoland/deno#16298). Chromium based browsers run each tab as its own process. WIth the example, we technically have 3 concurrent processes running. Server and 2 Client tabs running on the server. |
I should have pin pointed what exact concurrency mentions. In the docs it states you can add a custom ConcurrencyImplementation in js which is not the same. From the nodejs aspect it does not matter if there is 100 browsers running. The execution is not happening concurrent to connect and drive the pages. Using a word that has a bigger impact than stating it can open several chrome processes is a totally different thing. |
In order for concurrent operations to happen a child process is required and within each child process managing the browser. In nodejs you can only fork separate processes https://nodejs.org/api/cluster.html since the nodejs runtime is required in each one. This makes it really not possible or meant for concurrency. You can do handle things parallel just not concurrent. |
@j-mendez a new change to libuv may change that. Seems like node is getting multithreading. |
This package states concurrency when this is not the same thing as parallel. Nodejs does not have the ability to run concurrent without using the expensive child processes that require the heavy runtime per instance. When using fork on nodejs via web server is also not a good idea unless the forks are spawned prior/limited very heavy operation.
The text was updated successfully, but these errors were encountered: