Is there a copy of the main process in the memory of the windows python subprocess?
高洛峰
高洛峰 2017-06-12 09:23:56
0
1
882

When viewing the multi-process documentation, I saw a description that the memory of the child process created by os.fork() or mutiprocess and the main process have a copy on write mechanism, which means that the child process will copy the memory of the main process.

Because the document I saw was on Linux, I tested it on Windows.
Read a larger document in the main process and then create the process, and directly create the child process.
After comparison, only one of the processes has larger memory usage.

Excuse me, will Python copy the memory of the main process when creating a sub-process in Windows? If copying occurs, at which step does it occur? Create a subprocess, start a subprocess, or copy on write? Are there any books that explain the various uses of python in more detail and systematically?

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(1)
滿天的星座

Copy-on-write (COW) is only for the fork implementation, but in windows it is directly CreateProcess, which should not happen. For details, you can Google the principle and implementation of CreateProcess, as well You can refer to the following link:
Creating a process under windows, detailed explanation and usage of CreateProcess()

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template