The parent process and the child process can be executed concurrently; both the parent process and the child process are the smallest unit of resource allocation by the system. They are independent processes and can be run concurrently. Concurrency is not executed at the same time on a micro level. , just divide the time into several segments, so that multiple processes can be executed rapidly and alternately. From a macro perspective, it seems that these processes are all executing.
The operating environment of this tutorial: Windows 10 system, DELL G3 computer.
Can the parent process and the child process be executed concurrently?
Can be run concurrently,Because both the parent process and the child process are the smallest unit of resource allocation by the system. Independent processes can run concurrently, which is different from the relationship between processes and threads.
"Parallel" means that both micro and macro are executed together, just like two people digging a hole with a shovel each. After one hour, each person A big hole.
"Concurrency" is not executed at the same time from a micro perspective. It just divides the time into several segments so that multiple processes can execute quickly and alternately. From a macro perspective, it seems that these processes are all Execution is like two people using the same shovel and taking turns digging a hole. After an hour, they each dig a smaller hole. If they want to dig two larger holes, it will definitely take two hours.
It is not difficult to see from the above essence that "concurrent" execution does not fundamentally improve execution efficiency when multiple processes have resource conflicts.
Father and son processes are concurrent.
In a single processor, multi-processing does not make much sense. Multi-tasking on a single processor can only be concurrent (polling alternately with time slices). At this time, macroscopically, it is multi-tasking. Running together is actually done in alternating time slices from a micro perspective. Therefore, although they are run together from a macro perspective, the time used to execute one process and one process does not save much. When there is a process that needs to be suspended or slept, there will be It may take a little longer, but if there is no suspend or sleep, the time may take a little longer, because it is also consumed by the continuous process conversion of the kernel in the time slice.
But in multi-processors, multitasking can really achieve parallelism. Multiple processes are executed on different processors. Only when resource conflicts and synchronization are needed, pause and wait for others. Time is truly executed asynchronously and simultaneously. But as mentioned above, when multiple processes have resource conflicts, execution efficiency is not fundamentally improved.
For more related knowledge, please visit the FAQ column!
The above is the detailed content of Can the parent process and child process execute concurrently?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SublimeText3 English version
Recommended: Win version, supports code prompts!

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.