Os 3 Flashcards

1
Q

What is CPU scheduling?

A

CPU scheduling is the mechanism that selects which process in the ready queue will be assigned to the CPU next.

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

When is CPU scheduling necessary?

A

When more than one process is ready to run but the CPU is free — i.e., multitasking or time-sharing systems.

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

What are the main CPU scheduling criteria?

A

CPU utilization, throughput, turnaround time, waiting time, response time.

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

What is non-preemptive scheduling?

A

Once a process is assigned the CPU, it keeps it until it voluntarily releases it (e.g., finishes or blocks for I/O).

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

What is preemptive scheduling?

A

Processes can be interrupted and the CPU reassigned, usually based on priority or time quantum expiration.

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

What is First-Come, First-Served (FCFS) scheduling?

A

Processes are executed in the order they arrive in the ready queue; simple but can cause long waiting times (convoy effect).

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

What is Shortest Job First (SJF) scheduling?

A

The process with the smallest estimated run-time-to-completion is selected next, minimizing average waiting time.

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

What is the difference between preemptive SJF and non-preemptive SJF?

A

Preemptive SJF (Shortest Remaining Time First) allows a shorter job to preempt a running process; non-preemptive SJF does not.

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

What is Priority Scheduling?

A

Each process is assigned a priority, and the CPU is allocated to the process with the highest priority (smallest numerical value if lower number = higher priority).

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

What is the problem of starvation in Priority Scheduling?

A

Low-priority processes may never execute if higher-priority processes keep arriving.

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

What is Aging in CPU scheduling?

A

Gradually increasing the priority of waiting processes to prevent starvation.

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

What is Round-Robin (RR) scheduling?

A

Each process gets a fixed time slice (quantum); after that, it’s preempted and moved to the end of the ready queue.

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

What are the advantages of Round-Robin scheduling?

A

Fairness (all processes get CPU time) and good response time for time-sharing systems.

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

How is time quantum size critical in Round-Robin?

A

Too small = too much overhead (frequent context switches); too large = similar to FCFS.

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

What is Multilevel Queue Scheduling?

A

Processes are divided into queues based on type (e.g., foreground, background), each with different scheduling policies.

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

What is Multilevel Feedback Queue Scheduling?

A

A multilevel queue system where processes can move between queues based on behavior (e.g., CPU bursts).

17
Q

What is Concurrency?

A

Concurrency is the execution of multiple processes or threads simultaneously (or appearing to be simultaneous) to improve resource utilization and responsiveness.

18
Q

What is a critical section problem?

A

When two or more processes access shared resources simultaneously, risking data inconsistency or race conditions.

19
Q

What are the three requirements for solving the critical section problem?

A

Mutual exclusion, progress, bounded waiting.

20
Q

What is Mutual Exclusion?

A

At most one process can be inside the critical section at any time.

21
Q

What is a race condition?

A

When the behavior of a program depends on the relative timing of processes, leading to unpredictable results.

22
Q

What is a semaphore?

A

A semaphore is a synchronization tool used to control access to a shared resource by multiple processes in a concurrent system.

23
Q

What are the two types of semaphores?

A

Counting semaphores (integer value) and binary semaphores (0 or 1, like mutex locks).

24
Q

What are the basic operations on semaphores?

A

Wait (P) — decrease the semaphore value; Signal (V) — increase the semaphore value.

25
Q

What is busy waiting?

A

When a process continuously checks for a condition to be true, wasting CPU cycles.

26
Q

How do semaphores solve the busy waiting problem?

A

By blocking a process when it cannot proceed, instead of forcing it to spin and check constantly.