Chapter 24 Flashcards

1
Q

What are 3 classical problems of synchronization

A

1- Bounded-buffer problem
2- Readers and writers problem
3- Dining philosophers problem

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

What mutex stands for

A

mutual exclusion

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

What is reader and writers problems

A

There is a shared object in multiple readers and writers. Multiple processes can read. That is fine but if something is writing on shared object then read should not be allowed. If write operation is on the go, and we allow multiple readers to read it then every reader might get different value. And there should not be multiple write operations at a time.

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

What are 2 solutions of readers and writers problem

A
  1. First readers and writers problem

2. Second readers and writers problem

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

What is First readers and writers problem

A

No reader will be kept waiting unless a writer has already obtained permission to use the shared object.

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

What is second readers and writers problem

A

It a writer is ready, it waits for the minimum amount of time.

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

What are dining philosophers problem

A

There are 5 philosophers and their life is thinking and eating. They have only 2 chopstick and they agreed first they will carry right chopstick and then left chopstick. But one sad day all 5 become hungry at the same time and all of them picked right chopstick. They halted and all died because of hunger. It is problem of starvation.

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