Chapter 5 Flashcards

1
Q

Does Wait-Free Imply Mutual exclusion

A

No

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

What is the problem with mutual exclusion?

A

If something happens to a register that has a lock the rest of the registers have to wait until lock is released

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

What does the principle of consensus determine?

A

The power of sync primitives

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

What is the basic idea of Consensus

A

Each class in hierarchy has an associated consensus number

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

What is a Consensus number?

A

Max no of threads for which objects can solve consensus

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

What method does a consensus object have?

A

decide()

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

what does decide() return in consensus object?

A

a value that is consistent and valid (all threads decide the same value, the common decision value is some thread’s input)

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

Can 2 threads reach consensus on 2 values using atomic registers?

A

No

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

What consensus number does an atomic number have?

A

1

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

What does a sequential number of 1 mean?

A

only 1 thread can solve it so its sequential

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

Can a FIFO Queue Implement Consensus?

A

Yes, but only for 2 threads (consensus number 2)

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

What does RMW stand for?

A

Read-Modify-Write

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

What are the RMW Methods? and which one takes 2 values?

A

getAndSet(x)
getAndIncrement()
getAndAdd(k)
get()
compareAndSet() <= takes 2 values

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

what is the consensus number of non-trivial RMW objects?

A

2

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

What methods do subclasses of consensus have?

A

propose(x)
decide(object value)

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

If a RMW object overwrites/commutes what is the consensus number?

A

2

17
Q

Examples of Common2 RMW operations

A

getAndSet()
getAndAdd()
getAndIncrement()

18
Q

What is the consensus number of compareAndSet() and get()

A

Infinite