HUST OS 4.2 the process of self-control [notes]

Copyright: learning, can there be so many rules ~ https://blog.csdn.net/Irish_Moonshine/article/details/91128173

4.2 Process Control

4.2.1 Process control concepts:
4.2.2 windows process control
4.2.3 Linux Process Control
4.2.1 Process control concepts:
  • During the whole process of living, their overall behavior of the control of
    four typical control behavior
  1. Process Create
    Create a blank PCB
    is obtained and given process identifier ID
    for the process allocates space
    initialization PCB
    into the appropriate process queue (ready default)
  2. The process of revocation
    revocation of a specified process
    to recover the process share some resources, revoke the process of PCB
    [recursive revocation of the child]
    3. The process of blocking
    to stop the implementation process, becomes blocked.
    Blocking time / event
    Request System Services / start some action / new data has not arrived / no new jobs can be used

4. Process wake
wake up in a process of blocking queue which
caused time to wake up / events: The system does not meet the service becomes satisfied / I / O completion
/ new data arrives / process put forward a new request (service)

4.2.2 windows process control

CreateProcess () // create a new process

  • Creating a new process:
    1. Create a process kernel object, create a virtual address space
    2. EXE load and / or DLL code and data into the address space
    3. Create a thread and the main thread kernel object
    4. Start the main thread, into the main function ( main)

  • End Process:
    ExitProcess (inform the operating system they were going to end, mild end)
    the TerminateProcess (forcibly terminated by the Task Manager to end the violence)

4.2.3 Linux Process Control

Create a process fork ()
returns an integer pid_t

pid_t pid = fork()

exec function cluster (includes a number of functions)
Function:
Load a specified executable program run
the child process and the parent process has completely different new features

Guess you like

Origin blog.csdn.net/Irish_Moonshine/article/details/91128173