Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— 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

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 command ps -l

15

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 Commands in 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 be run by the user


Download ppt "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."

Similar presentations


Ads by Google