Overview of process and operating system
The basic process
Procedures and processes:
Program is a bunch of static code files
It is a process that is running the program, abstraction
Call control process by the operating system to run CPU
operating system
Relationship management control to coordinate computer hardware and software
The role of the operating system:
The complex ugly interface hardware operations into a simple beautiful interface. Open function.
When multiple processes to seize a (CPU) resources, your operating system will become reasonable and orderly execution.
阻塞: input read write sleep recv accept sendto recvfrom .....
History of operating system development
Computers first appeared: abacus.
History of the development of computer electronics:
First computers 1940 ~ 1955
There was room in the university, I want to use the computer must make an appointment.
Connect the various hardware formulation, 1.5 hours, vacuum, and then plug in program debugging. Inefficiencies
Advantages: Exclusive entire personal computer resources.
Cons: hardware debugging plug wire, time-consuming, all are serial execution
Second generation computer tape storage system 1955 to 1965 --- Batch
- advantage:
- Programmers do not personally hardware plug wire control, improve efficiency
- You can perform batch processing code
- Disadvantages:
- In other words you can not use a computer program alone
- Your desired program or serial
- advantage:
Third Generation Computer: integrated circuits, multiprogramming system
Large background:
- IC: with all the hardware becomes small, the circuit board
- The two different production lines into a production line
Technical updates: multi-channel technology
1. Spatial multiplexing on: the memory sub-region, a memory can be loaded multiple processes
2. multiplexed on time: the implementation will switch back and forth between multiple CPU processes, and reservation status
Almost all programs have blocking IO,
At the same time loaded into memory three tasks, three processes, each process has a blocking situation, as long as the cpu running a process, met immediately switch back to blocking IO, cpu will switch prolonged occupation.
Improve efficiency, maximize the use of cpu.
If an IO-intensive process, switch back and forth improve efficiency.
If it is a computationally intensive, reducing the efficiency of the toggle.
After the third generation of widely used computer hardware must be protected (program memory between isolated from each other), the third generation of computer applications and health:
Each person occupies a limited computer time,
People (less than 10) share a host computer,
The fourth generation of computers: so far.
Theory of the process:
Serial: All tasks one by one to complete.
Concurrency: a cpu to complete multiple tasks at the same time look like complete.
Parallel: multiple cpu to perform multiple tasks, complete real time.
Obstruction: cpu encountered IO is blocked.
Non-blocking: there is no IO, called non-blocking
Program: a bunch of static files
A task program is being executed, a process.
A program can open multiple processes? Can.
Process of creation:
A child must rely on a primary process before they can open.
A master process can open multiple sub-processes.
unix: fork to create a child process.
unix (linux, mac): Creates a child process will completely copy all of the resources a primary process, initial resource unchanged.
windows: the operating system call CreateProcess to create a treatment process.
windows: create a child process will copy all the resources the main process, but will change some resources.
State of the program: