Chapter 22 Flashcards

1
Q

What are semaphorse in operating system solutions

A

semaphorse is a synchronization tool. It is available in operating system. It is an integer variable that can only be accessed via two indivisible (atomic) operations, called wait and signal. example of a white road block in traffic signal. A car or a bus can cross it at a time.

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

What are 2 operations used by semaphorse

A
  1. Wait

2. Signal

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

What wait operation do in semaphorse

A

It keeps waiting and wait for value of semaphorse that is less than equal to 0 to increase.

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

What are 2 types of atomic execution

A
  1. Uni-processor environment

2. Bus-based multi-process environment

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

What is Uni-processor environment

A

We inhibit interrupts before executing code of wait() and signal()

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

What is bus-based multi-processor environment

A

we use software solution in it (e.g. bakery algorithm). we lock the data bus

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

What is busy waiting

A

processes keep waiting and in loop. Its a wastage of CPU resources.

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

What are 2 simple operations in semaphore implementation

A
  1. block() suspends the process that invoke it

2. wakeup() resume the execution of blocked process

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

What is the meaning of negative value of a semaphore

A

The negative value of s value indicates the number of processes waiting for semaphore.

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

How to stop busy waiting

A

We put semaphore queue so process spinning in a loop should be waiting in a queue.

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

What is atomic operation

A

An operation that performs interrupted. e.g. 2 atomic operations can not take place at the same time on a semaphorse.

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