Node-Webkit on Windows runs in 3 different process

2019-03-02 04:44发布

问题:

I'm sorry if this is a duplicate. I tried to Google the answer but it isn't very helpful.

If I run a node-webkit app using nw ., and then open Windows Task Manager, there are three different processes by the name of nw running. I have checked repeatedly but there is a single node-webkit application running on my system. Also, if I "End Task" any one of them, the app exits and the other two processes vanish too.

  1. Is that normal behaviour?
  2. Is there a documented explanation behind this?

Here is a screenshot.

Sidenote: I used Process Explorer to see the details of these processes and found out that two of these are children of the third. Command-line arguments for both children are different and very long. The parent is what I actually executed i.e. nw .

I know that Google Chrome uses a novel software architecture which makes each tab (and plugin) run as a separate process, thus making resource-management more manageable and efficient (?) Is that what is going on here?


Please forgive my ignorance. I don't have any advanced knowledge of Windows or Node/-Webkit. I'm looking to learn something out of this. So any links to man-pages, FAQs, docs etc will be greatly appreciated.

回答1:

It should be at least two. Because Chromium has the multiprocess architecture and node-webkit is based on Chromium:

http://www.chromium.org/developers/design-documents/multi-process-architecture