IPC and Synchronization Flashcards

1
Q

What are the two types of IPC?

A

Message-based and shared memory based

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

What is message based IPC?

A

Send/recv messages between two processes. OS is responsible for maintain. (-) user-kernel boundary crossing

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

What is shared memory based IPC?

A

OS creates a buffer in physical memory and then maps that memory into each process space

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

Types of message-based IPC?

A

Pipes (stream of bytes) and queues (sockets, queue of messages)

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

What is a spinlock?

A

Lock that spins while it is waiting. Another tasks cannot be scheduled on the CPU while it is waiting, but it can be preempted

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

What is a semaphore?

A

Generalized version of a mutex, has counter. On lock, if counter > 0, it will decrement and proceed. Increments when it leaves critical section

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

What is a monitor?

A

Higher-level synchronization mechanism that is equivalent to a mutex + condition variable. Ex. Java synchronization keyword

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

What hardware guarantees are there for special multi-step instructions used by lock implementations?

A
  1. Atomic (either fully executes or not at all)
  2. Mutually exclusive - only one thread at a time
  3. Multiple requests will be queued
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is cache coherence?

A

Each CPU has its own cache, so if you update a value on one cache, the others must be updated as well

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

What is NCC architecture

A

Non-cache coherent. Coherence must be handled by software

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

What is CC arch?

A

Cache-coherent. Done by hardware.

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

What is write-invalidate?

A

Cache coherence mechanism that invalidates a cache’s value

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

What is write-update?

A

Cache coherence mechanism that updates a cache’s value when it has been changed elsewhere

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

How to atomic operations achieve cache consistency?

A

They skip the cache and read directly from main memory

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