Presentation is loading. Please wait.

Presentation is loading. Please wait.

Process Relationships Chien-Chung Shen CIS, UD

Similar presentations

Presentation on theme: "Process Relationships Chien-Chung Shen CIS, UD"— Presentation transcript:

1 Process Relationships Chien-Chung Shen CIS, UD

2 Introduction Every process has a parent process ( init is its own parent) The parent is notified when the child terminates; parent obtains the child’s exit status Process group Session Login shell and other (child) processes Signal

3 Terminal Login Dumb terminal connected to a host with hard-wired connections: local (directly connected) or remote (via a modem) Login came through a terminal device driver in the kernel  a fixed # of terminal devices and hence logins GUI and windowing systems  “terminal windows” emulate character-based terminals

4 Process Group Process has PID and belongs to a group A process group is a collection of processes associated with the same job, that can receive signals from the same terminal Process group ID #include pid_t getpgrp(void); pid_t getpgid(pid_t pid ); getpgid(0) == getpgrp()( calling process) Each process group has a leader, whose process group ID == its PID

5 Sessions A session is a collection of one or more process groups proc1 | proc2 & proc3 | proc4 | proc5

6 Controlling Terminal A session can have a single controlling terminal - the terminal device (a terminal login) or pseudo terminal device (a network login) on which we log in The session leader that establishes the connection to the controlling terminal is the controlling process The process groups within a session can be divided into a single foreground process group and one or more background process groups If a session has a controlling terminal, it has a single foreground process group and all other process groups in the session are background process groups Whenever press terminal’s interrupt key (^C), the interrupt signal is sent to all processes in the foreground process group

7 Controlling Terminal

8 Job Control Start multiple jobs (groups of processes) from a single terminal and to control which jobs can access the terminal and which jobs are run in the background A job is simply a collection of processes, often a pipeline of processes vi main.c // starts a job of one process in the foreground pr *.c | lpr & make all & // start two jobs in the background

9 Job Control

Download ppt "Process Relationships Chien-Chung Shen CIS, UD"

Similar presentations

Ads by Google