Home > Common Problem > body text

What are processes and threads

清浅
Release: 2020-10-13 10:03:37
Original
54749 people have browsed it

Process is the basic unit of resource allocation. It is an instance of program execution and is created when the program is running. Thread is the smallest unit of program execution and is an execution flow of the process. One thread consists of multiple threads. consist of.

What are processes and threads

What is a process

A process is the basic unit of resource (CPU, memory, etc.) allocation, it is a program An instance at execution time.

When the program is running, the system will create a process, allocate resources to it, and then put the process into the process ready queue.

When the process scheduler selects it, it will allocate CPU to it. time, the program starts to actually run.

What are processes and threads

What is a thread

A thread is the smallest unit of program execution. It is an execution flow of the process and a CPU scheduler. and assigned basic units.

A process can be composed of many threads. All resources of the process are shared between threads. Each thread has its own stack and local variables.

Threads are scheduled and executed independently by the CPU, allowing multiple threads to run simultaneously in a multi-CPU environment. Similarly, multi-threading can also implement concurrent operations, and each request is assigned a thread to process.

What are processes and threads

The above is the detailed content of What are processes and threads. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template