9 - Dining Philosophers, Locks, Mutexes Flashcards

1
Q

What is Deadlock?

A

A state in which each member of a group is waiting for another member, including itself, to take action, such as sending a message or more commonly releasing a lock.

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

What is Livelock?

A

States of the processes involved in the livelock constantly change with regard to one another, none progressing.

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

What is the Arbitrator Solution?

A

One thread gets to go at a time.

Non-optimal use of resources

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

What is the Random Timeout Solution?

A
If resources are not availible, thread takes a short RANDOM sleep.
A small (likely non-permanent) chance of starvation.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the Resource Hierarchy Solution?

A

Establishes a partial order on resources

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

What is a Mutex?

A

Mutex = Mutual Exclusion

A synchronization mechanism used for ensuring exclusive access to a resource in concurrent programs.

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

What is Unfairness?

A

Not all processes get equal opportunity to progress

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

Name/explain two general approaches for cancelling a thread.

A
Asynchronous
 - pthread_kill()
Deferred / Synchronous
 - Setting some shared global flag
 - pthread_cancel()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Are signals handled per thread or per process?

A

Per process

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

Race Conditions are not a problem among processes, only threads.
True or False?

A

False

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

A mutex has only two states: Locked and unlocked.

True or False?

A

True

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