Test 1 Flashcards

1
Q

What does a CPU scheduler do?

A

Selects from among the processes in ready queue, and allocates a CPU core to one of them

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

When are CPU scheduling decisions made?

A

When a process:

  1. Switches from running to waiting state
  2. Switches from running to ready state
  3. Switches from waiting to ready
  4. Terminates
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the dispatcher module?

A

Gives control of the CPU to the process selected by the short-term scheduler; this involves:

  • switching context
  • switching to user mode
  • jumping to the proper location in the user program to restart that program
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is dispatch latency?

A

Time it takes for the dispatcher to stop one process and start another running

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

What are the scheduling criteria?

A
  • CPU utilization – keep the CPU as busy as possible
  • Throughput – # of processes that complete their execution per time unit
  • Turnaround time – amount of time to execute a particular process
  • Waiting time – amount of time a process has been waiting in the ready queue
  • Response time – amount of time it takes from when a request was submitted until the first response is produced, not output (for time-sharing environment)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is FCFS scheduling?

A

First-Come First-Served scheduling. Processes are ran in the order that they arrive.

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

What is the Convoy effect?

A

When short-processes are stuck behind long processes.

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

What is SJF scheduling?

A

Associate each process the length of its next CPU burst and use these lengths to schedule the process with the shortest time.

SJF is optimal, it gives the minimum average waiting time for a given set of processes, but the difficulty is knowing the length of the next CPU request.

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

How do you determine the length of the next CPU burst?

A

Tn+1 = atn + (1-a)Tn
tn = actual length of nth CPU burst
Tn+1 = predicted value for the next CPU burst
a0 <= a <= 1

Commonly a set to 1/2

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

What is RR scheduling?

A

Round Robin scheduling. Each process gets a small unit of CPU time (time quantum q) usually 10-100ms. After this time has elapsed, the process is preempted and added to the end of the ready queue..

If there are n processes in the ready queue and the time quantum is q, then each process gets 1/n of the CPU time in chunks of at most q time units at once. No process waits more than (n-1)q time units.

Timer interrupts every quantum to schedule next process.

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

What is priority scheduling?

A

A priority is associated with each proces.

The CPU is allocated to the process with the highest priority.

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

What is starvation and aging?

A

In priority scheduling starvation means that low priority processes may never execute. The solution to this is increasing the priority of the process as it ages, referred to as aging.

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

What is the effect of quantum size in RR?

A

If q large, it is similar to a FIFO algorithm. If q is too small overhead will be too high with constant switching.

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

What is a multilevel queue?

A

With priority scheduling having separate queues for each level of priority. Schedule the process in the highest-priority queue.

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

What is a multilevel feedback queue?

A

A multilevel queue where processes can move between the various queues, aging can be implemented this way.

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

What defines multilevel feedback queue schedulers?

A
  • Number of queues
  • Scheduling algorithms for each queue
  • Method used to determine when to upgrade a process
  • Method used to determine when to demote a process
  • Method used to determine which queue a process will enter when that process needs service.
17
Q

What is thread scheduling? What are the types?

A
  • Distinction between user-level and kernel-level threads
  • When threads supported, threads are scheduled, not processes
  • Many-to-one and many-to-many models, thread library schedules user-level threads to run on LWP
  • -Known as process-contention scope (PCS) since scheduling competition is within the process
  • -Typically done via priority set by programmer
  • Kernel thread scheduled onto available CPU is system-contention scope (SCS) – competition among all threads in system
18
Q

What is multiple-processor scheduling?

A
  • CPU scheduling more complex when multiple CPUs are available
  • Multiprocess may be any one of the following architectures:
  • -Multicore CPUs
  • -Multithreaded cores
  • -NUMA systems
  • -Heterogeneous multiprocessing
19
Q

What is SMP?

A

Symmetric multiprocesseing where each processor is self scheduling. All threads may be in a common ready queue, each processor may have its own private queue of threads.

20
Q

What is multicore processing?

A
  • Recent trend to place multiple processor cores on same physical chip
  • Faster and consumes less power
  • Multiple threads per core also growing
  • -Takes advantage of memory stall to make progress on another thread while memory retrieve happens
21
Q

What are multithreaded multicore systems?

A
  • Chip-multithreading (CMT) assigns each core multiple hardware threads. (Intel refers to this as hyperthreading.)
  • On a quad-core system with 2 hardware threads per core, the operating system sees 8 logical processors.
22
Q

What are the 2 levels of multithreaded multicore systems?

A
  • The operating system deciding which software thread to run on a logical CPU
  • How each core decides which hardware thread to run on the physical core.
23
Q

What is load balancing? What are some methods?

A
  • Load balancing attempts to keep workload evenly distributed
  • Push migration – periodic task checks load on each processor, and if found pushes task from overloaded CPU to other CPUs
  • Pull migration – idle processors pulls waiting task from busy processor
24
Q

What is processor affinity? What are some kinds?

A
  • When a thread has been running on one processor, the cache contents of that processor stores the memory accesses by that thread.
  • We refer to this as a thread having affinity for a processor (i.e. “processor affinity”)
  • Load balancing may affect processor affinity as a thread may be moved from one processor to another to balance loads, yet that thread loses the contents of what it had in the cache of the processor it was moved off of.
  • Soft affinity – the operating system attempts to keep a thread running on the same processor, but no guarantees.
  • Hard affinity – allows a process to specify a set of processors it may run on.