Module 5 Flashcards
Redirection
modifying the location to which an input is taken from or an
output is sent for a given command; redirection operators are commutative,
meaning they can appear in swapped orders and produce the same result
○ “dup2” system call: implement redirection by passing in two file
descriptors (oldfd and newfd) and causing newfd to point to the file or
data structure that was pointed to by oldf
Standard input
the location where programs look for their inputs; for
programs initiated in command-line, this defaults to your terminal; Standard in
can be redirected, and child processes inherit standard in from their parent
process; the Standard in file descriptor is “0”
Standard output
the location where programs stream their outputs; for
programs initiated in command-line, this defaults to your terminal; Standard
out can be redirected, and child processes inherit standard out from their
parent process; the Standard out file descriptor is “1”
Pipe
a form of interprocess communication, providing a way to stream data
from one process to the other; pipes have a “write end” to which data gets
written by one process to be sent to another process, and a “read end” from
which the receiving process reads the incoming data
SIGPIPE
a signal generated when a process tries to write to a pipe whose
read end has been closed
Process pipelining
running multiple processes at the same time where the output
of one process is used as input to another process
Half duplex
data flows in one direction; pipes between two processes are in the half
duplex communication paradigm as data flows in one direction between the two
processes
FIFO
these are similar to pipes; while pipes are temporary and unnamed
connections, FIFOs are files with names that allow two processes to communicate by
writing to the file
Process group
collection of processes that are established in a way such that you
can send (or block) a signal to the entire group at the same time; the processes in a
pipeline are in a single process group
PGID
process group ID
Session ID
one instance of your login to your shell is a session, and all processes
launched in this session have the same session ID
SSH
a secure network protocol that allows a remote user to be authenticated to
login to a machine
Foreground process
there is always exactly one foreground process; this process
has access to interactive shell output (in the absence of explicit redirection) and
input, and receives all the terminal generated signals; the shell must wait on this
process before executing another process
Job terminal control
ability to manipulate multiple jobs from a single terminal and
also to allow us to toggle jobs between background and foreground
Synchronous waiting
a process waits finds out the outcome of another process by
implementing a loop that constantly checks for a signal; “busy wait”