1. The Process Abstraction Flashcards

1
Q

What exactly is an abstraction?

A

A separation between the policy (how it is thought of, represented, or otherwise handled) of a function and its mechanism (how it actually works)

Abstractions provide an interface to application programmers that separates policy (what the interface commits to accomplishing) from mechanism (how the interface is implemented)

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

How do abstractions simplify application design? (Hint: 3 big contributions)

A

They hide undesirable properties (like what?),
add new capabilities (like names and addresses for files),
and organize information (like how?)

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

How is a file an example of abstraction?

A

Files allow data to appear to the user to be contiguous blocks of memory, while in fact the data could be distributed all over the disk.

They also allow chunks of data to be named and organized into directories.

Files allow for data blocks on disk to be given access based on permissions.

In short, files map properties (like organizational info) onto disk blocks without troubling the user with the actual physical reality of the data they are working with.

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

What undesirable properties do file systems hide (abstract away)?

A

The fact that discs are super slow, that data is often distributed all over the disc and not in one place, and that disc storage can fail sometimes.

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

What new capabilities do files add?

A

Dynamic size and organization into directories

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

What information do files help organize?

A

Ownership, permissions, access time, modification time, type, etc

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

How are threads an example of abstraction (what do they abstract)?

A

Threads abstract the CPU

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

How are address spaces an example of abstraction (what do they abstract)?

A

Address spaces abstract physical memory

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

What do files abstract?

A

Files abstract the disc

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

What is the most fundamental OS abstraction?

A

The process is the most fundamental OS abstraction because it organizes information about other abstractions and represents a single “thing” that a computer is working on

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

What is a process?

A

A process is an abstraction that organizes information about other abstractions and represents a single thing that the computer is “doing”

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

How is a process different from other OS abstractions, like threads, address spaces, and files?

A

The process abstraction is not tied to a piece of hardware like threads, address spaces, and files. Instead, processes contain one or more threads, an address space, and zero or more open file handles representing files.

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

What is a protection boundary?

A

An abstracted boundary between processes that guarantees that one process cannot crash the machine it’s running on or affect other processes without explicit permission

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

What functionality must the OS guarantee in regard to communication between processes?

A

The OS must isolate processes from each other so that a process cannot crash the machine it is running on or affect any other process without permission

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

How do multiple threads in the same process communicate with each other?

A

They share memory within the address space of their process.

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

What resources are shared between multiple threads within the same process?

A

Memory, open file handles, static global variables, and dynamically-allocated global variables

17
Q

What resources are private to each thread within a process?

A

Individual thread stacks and thus thread local variables

18
Q

Why are synchronization primitives necessary to a fully functional multi-threaded process?

A

Because shared resources can be altered by multiple threads, we need synchronization primitives to protect those resources so that while one thread is modifying a shared resource, no other thread tries to read or modify that resource at the same time

19
Q

What does IPC stand for?

A

Inter-process communication