1 / 21

Chapter 13

Chapter 13. Processes. What is a process?. A process is a program in execution A process is created whenever an external command is executed Whenever the execution of the external command is completed, the process is terminated. CPU Scheduling.

Download Presentation

Chapter 13

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 13 Processes

  2. What is a process? • A process is a program in execution • A process is created whenever an external command is executed • Whenever the execution of the external command is completed, the process is terminated

  3. CPU Scheduling • CPU scheduling is the process of assigning the CPU to different processes • CPU scheduling takes into consideration many factors: • Whether the process is interactive or batch • The priority of the different processes • Process state of readiness • Past behavior of process

  4. Figure 13.1 LINUX process state diagram

  5. Table 13.1 A Brief Description of the LINUX Process States

  6. Figure 13.2  Process creation via the fork system call

  7. Figure 13.3  Steps for execution of a binary program sort by a LINUX shell

  8. Figure 13.3  Steps for execution of a binary program sort by a LINUX shell

  9. Figure 13.4  Steps for execution of a shell script by a LINUX shell

  10. Figure 13.5  Execution of commands under the child shells (also called subshells)

  11. Process Attributes • The system keeps track of several process attributes • The description of the current processes including their attributes can be displayed using the ps command • Syntax • ps [options] • Option syntax varies with SYS V (-), BSD ( ), GNU (--)

  12. ps Command Syntax ps [options] Option syntax varies with • SYS V (-l, -a, -N, -u ulist, …) • BSD ( l, a, U ulist, f, …) • GNU (--l, --a, …) • l long listing • a all processes (not just users) • N negate selection • U ulist info about other users’ processes • f ASCII art tree format

  13. Table 13.2 Some Process States and Their Meaning

  14. Table 13.3 Various Fields of the Output of the commandps -l

  15. Table 13.3 Various Fields of the Output of the commandps -l

  16. Process Control Commands • nice • kill • Running commands in the background using & • Suspending process using CTRL-Z • fg • bg • ps • top • pstree • jobs

  17. Daemons • Daemons are system processes running in the background in order to handle a variety of system services • Daemon examples: • mail daemon • print daemon • internet daemon

  18. Specifying Multiple Commandsin a Single Command Line • Several commands separated by “;” in a single command are executed sequentially • Several commands separated by “&” in a single command are executed in parallel

  19. Forced Termination • Foreground processes can be terminated using CTRL-C • Background processes can be terminated by: • Using kill • Bringing them to the foreground then using CTRL-C

  20. Figure 13.6  LINUX process hierarchy

  21. Process Hierarchy • The current process hierarchy can be displayed using the pstree command • The ulimit command can be used to determine the maximum number of simultaneous processes that can berun by the user

More Related