Mini test 2 Flashcards

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
Q

installation of Signal Handlers

A

use signal() or sigaction() to set a handler

26
Q

safety of Signal Handlers

A

handlers should be simple and only use async-signal-safe functions

27
Q

Blocking Signals mechanism

A

prevents the process from receiving certain signals temporally

28
Q

Blocking Signals usage

A

useful during critical sections of code to avoid interruptions

29
Q

Blocking Signals methods

A

sigprocmask() to block/unblock signals and sigsuspend() to wait for a set of blocked signals to occur

30
Q

I/O Basics

A

Involves copying data between main memory and external sources like disk drives and terminals

31
Q

I/O Unix Model

A

Treats all I/O devices as files, allowing for uniform file operations across devices

32
Q

Open files

A

open() system call is used to access a file; returns a file descriptor if successful

33
Q

Close file

A

close() system call releases resources associated with a file; important to check return status for errors

34
Q

File Descriptor

A

Small, non-negative integer that identifies an open file for the process

35
Q

Open File

A

Represents an actual instance of an open file, including its current position, access modes, and links to file data

36
Q

V-node Tables

A

Low-level structures that store metadata about a file, such as permissions, owner, size, and pointers to data blocks

37
Q

Shared/Unshared I/O Between Parent and Child Processes Inheritance

A

Child process inherits open file descriptors from its parent upon fork()

38
Q

Shared/Unshared I/O Between Parent and Child Processes Independence

A

Despite sharing file descriptors, file offset and file status flags are copied, allowing independent file operations

39
Q

Redirection (dup2) Purpose

A

dup2() system call is used to copy a file descriptor to another, replacing the latter, useful for I/O redirection

40
Q

Redirection (dup2) Common Use

A

Redirect output or input of a process to/from a file or another process

41
Q

Pipes Functionality

A

Allows for one-way communication between two processes; typically used to connect the output of one process to the input of another

42
Q

Pipes Implementation

A

Created using the pipe() system call which returns two file descriptors; one for reading and the other for writing