I. Processes and Threads
(1) Dispatch: The thread acts as the basic unit of dispatch and allocation, and the process as the basic unit of resources
(2) Concurrency: Not only can concurrent execution between processes, but also concurrent execution between multiple threads of the same process
(3) Owning a resource: a process is an independent unit that owns resources, and threads do not own system resources, but they can access resources that belong to the process.
(4) Overhead: When you create or revoke a process, the overhead of the system is significantly greater than the cost of creating or revoking a thread, because the system allocates and reclaims resources for it.
Second, CPU scheduling
Process execution consists of CPU execution and I/O wait cycles. The process switches between the two states
Algorithm:A. First come first served (FCFS) B. Shortest Job priority (SJF C. Priority scheduling (hunger and aging) D. maximum response ratio E. Rotation method
Third, deadlock
1. four necessary conditions for deadlock generation: (4 conditions can cause a deadlock) A. Mutex, B. Possession and wait, c. Non-preemption, D. Cyclic wait
2. If the allocation diagram is non-ring, then the system will have no process deadlock, if there is a ring, then there may be deadlock
3. Deadlock Prevention:
(1) For non-shared resources, there must be mutually exclusive conditions
(2) When a process requests a resource, it cannot be contaminated with other resources
(3) If a resource is occupied and another resource cannot be allocated immediately, then its allocated resources can be preempted
(4) All resource types are fully sorted and require each process to request resources in ascending order, and when a process requests a resource, he must release all the lower ordinal resources.
Banker algorithm.
Iv. page Replacement algorithm
1 first in, first Out method (FIFO)
2 optimal permutation algorithm (OPT)
3 Longest unused algorithm (LRU)
[Original] Operating system related concepts