2.21 operating system notes

Process switch:

If that is the process of switching the CPU resources to others, then itself into a wait state, where to put their own context preserved, commonly known as preserve the scene, and then the next time their turn and then proceed to recover the thread

Process Creation:

Use fork copy of the current process, the memory space of the current process, the cache, as well as program code segments etc. will be copied, this is a child process,

Representatives exec change the program running processes, and can with what some parameters, so you can overwrite the contents of the process, become a new process

After the parent process can wait (), used this method in the parent process will wait for the child's return value

1, there is a child process, waits

2, there is no direct exit

3, there are a lot of zombie process, then pick a value

Child process by exit () return value, using this method, it will give a value to the parent, the parent process to wait for treatment, if the parent process has not treated will become a zombie process

 

 

Scheduling:

The problem is how to switch between the selection process, there are several algorithms

1, first come first serve simple, but the average turnaround time is generally too high

2, short process priority is the lowest average turnaround time, but the process may be long hunger, lack of resource utilization has the last access time to guess estimate, the results

3, a high response ratio (s + t) / s calculated response time        

Guess you like

Origin www.cnblogs.com/Lis-/p/12342913.html