Chapter 5 & 7 (Quiz 5 Portion) Flashcards

1
Q

What is the “Critical section” problem?

A

1- Process may be changing common variables, updating table, writing file, etc.
2- When one process in critical section, no other may be in its critical section.

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

What are the solutions to Critical-Section problem?

A

1- Mutual Exclusion.
2- Progress.
3- Bounded Waiting.

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

What is “Mutual Exclusion” ?

A

If process Pi is executing in its critical section, then no other processes can be executing in their critical sections.

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

What is “Progress” ?

A

If no process is executing in its critical section and there exist some processes that wish to enter then cannot be postponed indefinitely.

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

What is the difference between Preemptive & Non-preemptive kernel in Critical-Section Handling in OS?

A

1- Preemptive : allows preemption of process when running in kernel mode.

2- Non-preemptive : runs until exits kernel mode, blocks, or voluntarily yields CPU.

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

Is there Critical-Section in Hardware? and why?

A

No, because of using locking.

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

What is the difference between “Uniprocessors” & “Modern machines” ?

A

Uniprocessors : could disable interrupts.
Modern machines : Atomic = non-interruptible.

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

What is “Semaphore”?

A

Synchronization tool that provides more sophisticated ways (than Mutex locks) for process to synchronize their activities.

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

What is “Starvation” in Process Synchronization?

A

A process may never be removed from the semaphore queue in which it is suspended.

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

What is “Priority Inversion”?

A

Scheduling problem when lower-priority process holds a lock needed by higher-priority process.

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

What are the 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
12
Q

What is the Readers and Writers Problem?

A

Allow multiple readers to read at the same time.

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

What is the Solution to the Readers and Writers Problem?

A

Using Priorities.

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

How does a process utilizes a resource?

A

1- Request.
2- Use.
3- Release.

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

What are the Deadlock Characterization?

A

1- Mutual exclusion.
2- Hold and wait.
3- No preemption.
4- Circular wait.

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

What is the “Mutual exclusion” from Deadlock Characterization?

A

Only one process at a time can use a resource.

17
Q

What is the “Hold and wait” from Deadlock Characterization?

A

A process holding at least one resource is waiting to acquire additional resources held by other processes.

18
Q

What is the “No preemption” from Deadlock Characterization?

A

A resource can be released only voluntarily by the process holding it, after that process has completed its task.

19
Q

What happens if Resource allocator graph contains no cycles?

A

No deadlock.

20
Q

What happens if Resource allocator graph contains a cycle?

A

1- If only one instance per resource type, then deadlock.
2- If several instances per resource type, possibility of deadlock.

21
Q

What is the “Mutual Exclusion” from the deadlock prevention?

A

Not required for sharable resources (read-only files).

22
Q

What is the “Hold and wait” from the deadlock prevention?

A

Must guarantee that whenever a process requests a resource, it does not hold any other resources.

23
Q

What is the “No preemption” from the deadlock prevention?

A

If a process that is holding some resources requests another resource that cannot be immediately allocated.

24
Q

What is the “Circular wait” from the deadlock prevention?

A

Impose a total ordering of all resource types.

25
Q

What happens if a system is in a safe state?

A

No deadlock.

26
Q

What happens if a system is in a unsafe state?

A

Possibility of deadlock.

27
Q

What is “Avoidance”?

A

Ensure that a system will never enter an unsafe state.

28
Q

What are the points for Recovery from Deadlock?

A

1- Process Termination.
2- Resource preemption.

29
Q

What is the “Process Termination” in Recovery from Deadlock?

A

1- Abort all deadlocked processes.
2- Abort one process at a time until the deadlock cycle is eliminated.

30
Q

In which order should we choose to abort? (Mention at least 5)

A

1- Priority of the process.
2- How long process has computed, and how much longer to completion.
3- Resources the process has used.
4- Resources process needs to complete.
5- How many processes will need to be terminated.
6- Is process interactive or batch?.

31
Q

What is the “Selecting a victim” from Resource Preemption?

A

Minimize cost.

32
Q

What is the “Rollback” from Resource Preemption?

A

Return to some safe state, restart process for that state.

33
Q

What is the “Starvation” from Resource Preemption?

A

Same process may always be picked as victim.