M5: Interacting with Processes: Managing Process Input and Output Flashcards

1
Q

Redirection

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

“dup2” system call :

A

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 oldfd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Standard input :

A

: 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”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Standard output:

A

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”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Pipes

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

SIGPIPE

A

a signal generated when a process tries to write to a pipe whose read end has been closed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Process pipelining:

A

running multiple processes at the same time where the output

of one process is used as input to another process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Half-duplex:

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

FIFOs

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Process group:

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

PGID

A

process group ID

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Session ID:

A

one instance of your login to your shell is a session, and all processes
launched in this session have the same session ID

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

SSH

A

a secure network protocol that allows a remote user to be authenticated to
login to a machine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Foreground process:

A

there is always exactly one foreground process group; this process group 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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Background processes:

A

there can be any number of background processes; these processes will allow the user to execute other programs and interact with the shell
without waiting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Job/terminal control:

A

ability to manipulate multiple jobs from a single terminal and also to allow us to toggle jobs between background and foreground

17
Q

Synchronous waiting:

A

a process waits finds out the outcome of another process by implementing a loop that constantly checks for a signal; “busy wait”

18
Q

Asynchronous waiting

A

process continues executing normally and when another
process has a signal to send, a generic SIGCHLD is sent to the executing process,
who handles the signal with a SIGCHLD signal handler

19
Q

What happen if reading from a pipe whose write end has been closed

A

Returns EOF

20
Q

Where are pipes maintained

A

OS

21
Q

What happens with pipes after execve

A

Still around, inherited by child

22
Q

Can I use Pipes to communicate between process that are not realated

A

Yes, but not generic pipes as we are using between parent and child.
Need to use named pipes