1 / 9

Process Relationships

Process Relationships. Chien -Chung Shen CIS, UD cshen@cis.udel.edu. 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

nigel
Download Presentation

Process Relationships

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. Process Relationships Chien-Chung Shen CIS, UD cshen@cis.udel.edu

  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 groupis a collection of processes associated with the same job, that can receive signals from the same terminal • Process group ID #include <unistd.h> pid_tgetpgrp(void); pid_tgetpgid(pid_tpid); • 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 foregroundprocess 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

More Related