Mini test 2 Flashcards

(42 cards)

1
Q

Processes

A

an instance of a running program

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

functionality of Processes

A

provides logical control flow and private address space

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

management of Processes

A

OS uses context switching and virtual memory

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

purpose of fork

A

creates a new child process

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

behavior of forking

A

returns twice: once in the parent (child’s PID) and once in the child (0)

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

characteristics of forking

A

child gets a copy of the parent’s address space and file descriptors

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

exec function

A

replaces the current process memory with a new program

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

exec usage

A

execve is a common variant that loads and runs a program

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

details of exec

A

maintains PID but overwrites memory, stack, and code

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

Process Graphs

A

visualize the partial ordering of operations in concurrent programs

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

features of Process Graphs

A

nodes represent operations; edges indicate execution order

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

Zombies

A

processes that have completed execution but still have an entry in the process table

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

cause of Zombies

A

occur when a parent process doesn’t immediately perform a wait to collect the child’s termination status

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

resolution of Zombies

A

parent performs reaping using wait or waitpid

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

functionality of wait

A

pauses the parent until any child terminates; reaps zombie processes

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

functionality of waitpid

A

more specific that wait, can wait for a specific process

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

wait/waitpid options

A

can use various flags to modify behavior, such as non-blocking waits

18
Q

Signals

A

notifications sent to a process by the OS indication that an event has occurred

19
Q

types of Signals

A

identified by integer IDs, like SIGINT for interrupt and SIGKILL for termination

20
Q

behavior of Signals

A

can be ignore, terminate the process, or be caught by a custom handler

21
Q

Traps

A

intentional, such as system calls of breakpoints; control returns to next instruction

22
Q

Faults

A

unintentional but can be recoverable; may re-execute the faulting instruction

23
Q

Aborts

A

unintentional and unrecoverable; leads to program termination

24
Q

Signal Handlers

A

custom functions defined by a program to respond to specific signals

25
installation of Signal Handlers
use signal() or sigaction() to set a handler
26
safety of Signal Handlers
handlers should be simple and only use async-signal-safe functions
27
Blocking Signals mechanism
prevents the process from receiving certain signals temporally
28
Blocking Signals usage
useful during critical sections of code to avoid interruptions
29
Blocking Signals methods
sigprocmask() to block/unblock signals and sigsuspend() to wait for a set of blocked signals to occur
30
I/O Basics
Involves copying data between main memory and external sources like disk drives and terminals
31
I/O Unix Model
Treats all I/O devices as files, allowing for uniform file operations across devices
32
Open files
open() system call is used to access a file; returns a file descriptor if successful
33
Close file
close() system call releases resources associated with a file; important to check return status for errors
34
File Descriptor
Small, non-negative integer that identifies an open file for the process
35
Open File
Represents an actual instance of an open file, including its current position, access modes, and links to file data
36
V-node Tables
Low-level structures that store metadata about a file, such as permissions, owner, size, and pointers to data blocks
37
Shared/Unshared I/O Between Parent and Child Processes Inheritance
Child process inherits open file descriptors from its parent upon fork()
38
Shared/Unshared I/O Between Parent and Child Processes Independence
Despite sharing file descriptors, file offset and file status flags are copied, allowing independent file operations
39
Redirection (dup2) Purpose
dup2() system call is used to copy a file descriptor to another, replacing the latter, useful for I/O redirection
40
Redirection (dup2) Common Use
Redirect output or input of a process to/from a file or another process
41
Pipes Functionality
Allows for one-way communication between two processes; typically used to connect the output of one process to the input of another
42
Pipes Implementation
Created using the pipe() system call which returns two file descriptors; one for reading and the other for writing