当前位置:网站首页>Differences among tasks, threads and processes

Differences among tasks, threads and processes

2022-07-01 08:42:00 Craftsman in Jianghu

         In most general ( time-sharing ) operating system ( Such as Linux,Windows) in , It is often said that threads 、 Process NOUN . In most real-time operating systems (RTOS)( Such as uCOS,FreeRTOS) in , It is often said that it is a task . What are the differences and connections between them ! See below .

Concept

process (Process) A program in a computer is about a running activity on a data set , Is the system resource allocation and scheduling of the basic unit , yes operating system The foundation of the structure . In modern thread oriented computer architecture , A process is a container for threads . A program is an instruction 、 Description of data and its organization , A process is an entity of a program .

Threads ( English :thread) yes operating system Be able to operate Dispatch Minimum unit of . It is contained in process In , yes process The actual operating unit in . A thread means process A single sequential control flow in , Multiple threads can be concurrent in one process , Each thread performs different tasks in parallel .

Mission It refers to people's daily life 、 Work 、 All kinds of purposeful activities engaged in recreational activities . In modern computers ,“ Mission ” It is also the basic work unit , In most real-time operating systems ( Such as uCOS,FreeRTOS) in , It's a real-time operating system   Carry out operations Dispatch Minimum unit of .

Easy to understand

Illustrate with examples : If the operating system of a computer is compared to a large factory . A process is an independent workshop in a factory , Threads are assembly line workers in the workshop . At least one worker in each workshop , There can also be multiple workers . these “ Worker ” Sharing all the resources in this workshop .

Like in FreeRTOS in , Task and thread have the same meaning , All are   operating system   Carry out operations Dispatch Minimum unit of . stay FreeRTOS Up and running Whole procedure namely For a process , This process also contains many Threads ( Mission ), Some of these threads are created automatically by the system , Some are created manually for users .

原网站

版权声明
本文为[Craftsman in Jianghu]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/182/202207010831454416.html