ProcessProcess Model
A process is an instance of a program that is executing
It is worth noting that if a program runs two times, it counts as two processes
Create a process
In a common system, there are four main events that cause process creation
Initialization of the ① system
② executes a running process called City to create a system call
③ user request to create a new process
④ initialization of a batch job
Status of the process
Run state (the moment the process actually consumes the CPU)
Ready state (can be run, but temporarily stopped because other processes are running)
Blocking state (the process cannot run unless an external event occurs)
New,terminated two states are mentioned in operating Systems concept.
※ Implementation of the process (PCB)
PCB (Process Control block) |
Process State |
Running,waiting |
Program counter |
Indicates the address of the next instruction that the process will execute |
CPU Registers |
Accumulator (accumulators), index registers, stack pointer (stack pointers), universal register (general-purpose registers), etc. |
CPU Scheduling information |
Process priority, dispatch queue pointers, and other scheduling parameters |
Memory-management Information |
Value of base and limit registers, page table or Segment table (page tables, or segment) |
Accounting Information |
CPU used, clock time elapsed since start, time limits |
I/O status information |
The list of I/O devices allocated to this process, a list of open files, and so on |
Use of thread threads
Why use threads under a process?
Because of the abstraction of the process, we were able to avoid the interruption of the timer context switch. Just because of the abstract concept of threading we were able to join a new element. Parallel entities share the same address space and all available data And this is a multi-process model (they have different address spaces) that cannot be expressed
Modern Operating Systems (Ⅰ)--2014.12.15