- Go Systems Programming
- Mihalis Tsoukalos
- 317字
- 2021-07-02 18:07:55
The various states of a Unix process
Strictly speaking, a process is an execution environment that contains instructions, user-data and system-data parts, and other kinds of resources that are obtained during runtime. A program is a file that contains instructions and data, which are used for initializing the instruction and user-data parts of a process.
Back when the Unix operating system was first introduced, computers had single CPUs without multiple cores and a small amount of RAM. However, Unix was a multiuser and multitasking operating system. In order to actually be a multiuser and do multitasking, it had to be able to run each individual process sporadically, which means that a process should have multiple states. The following figure shows the possible states of a process as well as the right path to go from one state to another:

There are three categories of processes: user processes, Kernel processes, and Daemon processes:
- User processes run in user space and usually have no special access rights
- Kernel processes are being executed in kernel space only and can fully access all kernel data structures
- Daemon processes are programs that can be found in the user space and run in the background without the need for a Terminal
Realizing that you cannot control the state of a process is really important, as this is the job of the scheduler of the operating system that runs in the kernel. Putting it simply, you cannot tell when the state of a process is going to change or when the process is going to go into the running state, so your code cannot count on any such assumptions!
- Learn Blockchain Programming with JavaScript
- SoapUI Cookbook
- WSO2 Developer’s Guide
- Python神經網絡項目實戰
- 精通Python自動化編程
- MongoDB,Express,Angular,and Node.js Fundamentals
- Essential C++(中文版)
- C語言程序設計實踐
- Joomla!Search Engine Optimization
- Android開發進階實戰:拓展與提升
- Enterprise Application Architecture with .NET Core
- Access 2016數據庫應用與開發:實戰從入門到精通(視頻教學版)
- PhoneGap 3.x Mobile Application Development Hotshot
- CISSP in 21 Days(Second Edition)
- Java基礎案例教程(第2版)