Table of Contents
Can the parent process and the child process be executed concurrently?
Home Common Problem Can the parent process and child process execute concurrently?

Can the parent process and child process execute concurrently?

Sep 02, 2022 am 11:29 AM
process

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.

Can the parent process and child process execute concurrently?

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!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Explain what the explorer.exe process is Explain what the explorer.exe process is Feb 18, 2024 pm 12:11 PM

What process is explorer.exe? When we use the Windows operating system, we often hear the term "explorer.exe". So, are you curious about what this process is? In this article, we will explain in detail what process explorer.exe is and its functions and effects. First of all, explorer.exe is a key process of the Windows operating system. It is responsible for managing and controlling Windows Explorer (Window

What is the process of com surrogate? What is the process of com surrogate? Sep 14, 2022 pm 02:56 PM

"com surrogate" is the process of "C:\Windows\System32\dllhost.exe"; when this process occurs, it usually means that the "COM+" component stops working. This process takes up a lot of space and even does not respond directly. This is because the computer is loading the file icon. Sometimes a problem occurs, causing the computer to become stuck. You can solve the stuck problem in the computer properties settings.

What kind of process is ccsvchst.exe? What kind of process is ccsvchst.exe? Feb 19, 2024 pm 11:33 PM

ccsvchst.exe is a common process file that is part of the Symantec Endpoint Protection (SEP) software, and SEP is an endpoint protection solution developed by the well-known network security company Symantec. As part of the software, ccsvchst.exe is responsible for managing and monitoring SEP-related processes. First, let’s take a look at SymantecEndpointProtection(

How to properly kill zombie processes in Linux How to properly kill zombie processes in Linux Feb 19, 2024 am 10:40 AM

In Linux systems, zombie processes are special processes that have been terminated but still remain in the system. Although zombie processes do not consume many resources, if there are too many, they may cause system resource exhaustion. This article will introduce how to correctly remove zombie processes to ensure the normal operation of the system. 1Linux zombie process After the child process completes its task, if the parent process does not check the status in time, the child process will become a zombie process. The child process is waiting for confirmation from the parent process, and the system will not recycle it until it is completed. Otherwise, the zombie process will continue to hang in the system. To check whether there are zombie processes in the system, you can run the command top to view all running processes and possible zombie processes. The result of the ‘top’ command can be seen from the figure above in Linux.

Detailed explanation of Linux process priority adjustment method Detailed explanation of Linux process priority adjustment method Mar 15, 2024 am 08:39 AM

Detailed explanation of the Linux process priority adjustment method. In the Linux system, the priority of a process determines its execution order and resource allocation in the system. Reasonably adjusting the priority of the process can improve the performance and efficiency of the system. This article will introduce in detail how to adjust the priority of the process in Linux and provide specific code examples. 1. Overview of process priority In the Linux system, each process has a priority associated with it. The priority range is generally -20 to 19, where -20 represents the highest priority and 19 represents

How to stop Task Manager process updates and kill tasks more easily in Windows 11 How to stop Task Manager process updates and kill tasks more easily in Windows 11 Aug 20, 2023 am 11:05 AM

How to Pause Task Manager Process Updates in Windows 11 and Windows 10 Press CTRL+Window Key+Delete to open Task Manager. By default, Task Manager will open the Processes window. As you can see here, all the apps are endlessly moving around and it can be hard to point them down when you want to select them. So, press CTRL and hold it, this will pause the task manager. You can still select apps and even scroll down, but you must hold down the CTRL button at all times.

Why do processes in Linux sleep? Why do processes in Linux sleep? Mar 20, 2024 pm 02:09 PM

Why do processes in Linux sleep? In the Linux operating system, a process can become dormant due to a number of different reasons and conditions. When a process is in a dormant state, it means that the process is temporarily suspended and cannot continue execution until certain conditions are met before it can be awakened to continue execution. Next, we will introduce in detail several common situations when a process enters hibernation in Linux, and illustrate them with specific code examples. Waiting for I/O to complete: When a process initiates an I/O operation (such as reading

How to detect if there is no PHP process in Linux system How to detect if there is no PHP process in Linux system Mar 16, 2024 am 11:42 AM

"Detection method of no PHP process in Linux system, specific code examples are required" When using Linux system for web development, we often rely on PHP process to handle dynamic pages and logic, and sometimes we may need to monitor whether there is a PHP process on the server. This article will introduce a method to detect whether there is a PHP process in a Linux system and give specific code examples. Why is it necessary to detect the PHP process? In web development, the PHP process plays a vital role. It is responsible for parsing and executing PHP processes.