Operating Systems CSE 411 Process Management Sept. 13 2006 - Lecture 4 Instructor: Bhuvan Urgaonkar.
Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.
-
Upload
jeffery-morrison -
Category
Documents
-
view
213 -
download
0
Transcript of Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.
![Page 1: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/1.jpg)
Operating SystemsOperating SystemsCSE 411CSE 411
CPU ManagementCPU Management
Sept. 15 2006 - Lecture 5Sept. 15 2006 - Lecture 5
Instructor: Bhuvan UrgaonkarInstructor: Bhuvan Urgaonkar
![Page 2: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/2.jpg)
Today• Quickly revisit
– Timer interrupt, system clock– CPU management related data
structures– Process creation and termination
• Start CPU scheduling• Quiz 1
![Page 3: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/3.jpg)
Timer Interrupt, System Clock
• System clock drives the CPU circuit, no interrupt processing• Timer interrupt handled by OS, less frequent
CPU
TSC reg.++Oscillator
IRQ3
IRQ2
IRQ1
IRQ0
CLK
tick tick(Set by OS at bootup … coming soon)
Slower clocksto other components(e.g., memory, PCI bus)
jiffies++ (Linux)
![Page 4: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/4.jpg)
Today• Quickly revisit
Timer interrupt, system clockCPU management related data
structures– Process creation and termination
• Start CPU scheduling• Quiz 1
![Page 5: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/5.jpg)
Data Structure #1: PCB
• Can PCBs be swapped out?– Depends on the OS design .. so sometimes YES
Process id
Program Counter
…
Other registers
Process state
Ptr to linked list
Main Memory (RAM)
OS
Processes
![Page 6: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/6.jpg)
Data Structure #2: Linked Lists based on
Process States
![Page 7: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/7.jpg)
Ready
Waiting
Running
Disk
Lock
![Page 8: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/8.jpg)
Ready
Waiting
Running
Disk
Lock
Timer interrupt
![Page 9: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/9.jpg)
Ready
Waiting
Running
Disk
Lock
![Page 10: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/10.jpg)
Ready
Waiting
Running
Disk
Lock
I/O call
![Page 11: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/11.jpg)
Ready
Waiting
Running
Disk
Lock
OS (scheduler)
Hmm .. Who shouldI pick to run?
![Page 12: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/12.jpg)
Ready
Waiting
Running
Disk
Lock
OS (scheduler)
Lets pick the secondprocess in the readyqueue
![Page 13: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/13.jpg)
Today• Quickly revisit
Timer interrupt, system clockCPU management related data
structuresProcess creation and termination
• Start CPU scheduling
![Page 14: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/14.jpg)
Process Creation• When would a new process be created?
– When a user of the computer asks one to be created• That is, when an existing process asks for one to be created
– Therefore, there is going to be a parent-child relation among processes
– There must be a first process, then - the OS creates it during boot-up• Who is going to create it? The OS• What does the OS need to do?
– Needs to create a PCB• Assign a unique id to the new process
– Bring in the code and data for the new process into RAM– Move the new process to the ready queue, so the OS can schedule it
on the CPU
![Page 15: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/15.jpg)
Process Creationfork()
• Recall: Processes use system calls to request services from the OS
• OS provides a system call called fork() that a process can use to request the creation of a new process
• OS creates a new PCB when fork() is called with a unique id for the new process
• The calling process is the parent, the new process is the child• Then adds the child’s PCB to the ready queue• The child process is ready to go!• What code is the child going to execute?
![Page 16: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/16.jpg)
Specifying the Code the
Child should executeexec()
• Recall: Processes use system calls to request services from the OS
• OS provides a system call called exec() that a process can use to tell the OS what code it would like to execute
• Once the code and data are loaded into memory, the OS sets the PC (in the PCB) to the beginning of the child’s code
• What happens to the parent now???
![Page 17: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/17.jpg)
Process Creation:What happens to the
parent?
• The parent could wait for the child to finish– This is what a shell does
• Or it could go about its business
![Page 18: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/18.jpg)
Process Creation:Parent wants to wait
• Again, the parent process has to request the OS via a system call
• The wait() system call• The OS moves the parent to a
waiting queue• It would be moved to ready again
when the child terminates
![Page 19: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/19.jpg)
Process Creation:Parent doesn’t want to
wait
• Both the parent and the child would run whenever they are ready
![Page 20: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/20.jpg)
Process Creation• Why/when are processes created?
1. A user wants to run a program2. An existing process needs another process to
run the same code Why? More parallelism, make use of CPU even
when it gets moved to the waiting state
• So most OSes initialize the child process to have the same state as the parent
• Except the process id and a few other things
![Page 21: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/21.jpg)
Id=2000State=ready
PCB of parent
RAM
OS
ProcessesParent’s memory
Processcalls fork
Id=2001 1. PCB with newid created
2. Memory allocated for child
Initialized by copying over from the parent
Child’s memory
3. If parent had called wait, it is moved to a waiting queue
4. If child had called exec, its memory overwritten with new code & data
5. Child added to ready queue, all set to go now!
State=ready
PCB of child
![Page 22: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/22.jpg)
• #include <iostream>• #include <string>• #include <sys/types.h>• #include <unistd.h>• using namespace std;
• int globalVariable = 2;
• main()• {• string sIdentifier;• int iStackVariable = 20;
• pid_t pID = fork();• if (pID == 0) // child• {• // Code only executed by child
process
• sIdentifier = "Child Process: ";• globalVariable++;• iStackVariable++;• }
• else if (pID < 0) // failed to fork• {• cerr << "Failed to fork" << endl;• exit(1);• // Throw exception• }• else // parent• {• // Code only executed by parent
process
• sIdentifier = "Parent Process:";• }
• // Code executed by both parent and child.
• • cout << sIdentifier;• cout << " Global variable: " <<
globalVariable;• cout << " Stack variable: " <<
iStackVariable << endl;• }
Compile: g++ -o ForkTest ForkTest.cppRun: ForkTest
Parent Process: Global variable: 2 Stack variable: 20Child Process: Global variable: 3 Stack variable: 21
![Page 23: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/23.jpg)
Process Creation and Termination
![Page 24: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/24.jpg)
C Program Forking Separate Process
int main( ){pid_t pid;
/* fork another process */pid = fork( );if (pid < 0) { /* error occurred */
fprintf(stderr, "Fork Failed");exit(-1);
}else if (pid == 0) { /* child process */
execlp("/bin/ls", "ls", NULL);}else { /* parent process */
/* parent will wait for the child to complete */wait (NULL);printf ("Child Complete");exit(0);
}}
![Page 25: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/25.jpg)
Process Termination• Process executes last statement and asks the operating
system to delete it (exit)– Output data from child to parent (via wait)– Process’ resources are deallocated by operating
system• Parent may terminate execution of children processes
(abort)– Child has exceeded allocated resources– Task assigned to child is no longer required– If parent is exiting
• Some operating system do not allow child to continue if its parent terminates
– All children terminated - cascading termination
![Page 26: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/26.jpg)
TodayQuickly revisit
Timer interrupt, system clockCPU management related data
structuresProcess creation and termination
Start CPU scheduling• Quiz 1
![Page 27: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/27.jpg)
Ready
Waiting
Running
Disk
Lock
OS (scheduler)
Hmm .. Who shouldI pick to run?
![Page 28: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/28.jpg)
First-Come, First-Served Scheduling
(FCFS) Process Run Time
P1 24
P2 3
P3 3
• Suppose that the processes arrive in the order: P1 , P2 , P3
The Gantt Chart for the schedule is:
• Waiting time for P1 = 0; P2 = 24; P3 = 27• Average waiting time: (0 + 24 + 27)/3 = 17
P1 P2 P3
24 27 300
![Page 29: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/29.jpg)
FCFS Scheduling (Cont.)
Suppose that the processes arrive in the order P2 , P3 , P1
• The Gantt chart for the schedule is:
• Waiting time for P1 = 6; P2 = 0; P3 = 3• Average waiting time: (6 + 0 + 3)/3 = 3• Much better than previous case• Convoy effect short process behind long process
P1P3P2
63 300
![Page 30: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/30.jpg)
Shortest-Job-First (SJF) Scheduling
• Associate with each process the length of its next CPU burst. Use these lengths to schedule the process with the shortest time
• SJF is optimal for avg. waiting time – gives minimum average waiting time for a given set of processes– In class: Compute average waiting time for the previous
example with SJF– Prove it (Homework 1, Will be handed out next Friday)
• Two schemes: – nonpreemptive – once CPU given to the process it
cannot be preempted until completes its CPU burst– preemptive – if a new process arrives with CPU burst
length less than remaining time of current executing process, preempt. This scheme is know as the Shortest-Remaining-Time-First (SRTF)
![Page 31: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/31.jpg)
Choosing the Right Scheduling
Algorithm/Scheduling Criteria
• 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)
• Fairness
![Page 32: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/32.jpg)
When is the scheduler invoked?
• CPU scheduling decisions may take place when a process:1. Switches from running to waiting state2. Switches from running to ready state3. Switches from waiting to ready4. Terminates
• Scheduling only under 1 and 4: nonpreemptive scheduling
• All other scheduling is preemptive
![Page 33: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/33.jpg)
Dispatcher• Dispatcher module 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• Dispatch latency – time it takes for the
dispatcher to stop one process and start another running
![Page 34: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/34.jpg)
Example from Linux 2.6.xasmlinkage void __sched schedule(void){
[ . . . ]prepare_arch_switch(rq, next);prev = context_switch(rq, prev, next);barrier();
finish_task_switch(prev);[ . . . ]
}
task_t * context_switch(runqueue_t *rq, task_t *prev, task_t *next){
struct mm_struct *mm = next->mm;struct mm_struct *oldmm = prev->active_mm;
/* Here we just switch the register state and the stack. */ switch_to(prev, next, prev);
return prev;}
#define switch_to(prev,next,last) \
asm volatile(SAVE_CONTEXT \
"movq %%rsp,%P[threadrsp](%[prev])\n\t" /* saveRSP */ \
"movq %P[threadrsp](%[next]),%%rsp\n\t" /* restore RSP */ \
"call __switch_to\n\t" \
".globl thread_return\n" \
"thread_return:\n\t" \
"movq %%gs:%P[pda_pcurrent],%%rsi\n\t" \
"movq %P[thread_info](%%rsi),%%r8\n\t" \
LOCK "btr %[tif_fork],%P[ti_flags](%%r8)\n\t" \
"movq %%rax,%%rdi\n\t" \
"jc ret_from_fork\n\t" \
RESTORE_CONTEXT \: "=a" (last) \
: [next] "S" (next), [prev] "D" (prev), \
[threadrsp] "i" (offsetof(struct task_struct, thread.rsp)), \[ti_flags] "i" (offsetof(struct thread_info, flags)),\
[tif_fork] "i" (TIF_FORK), \
[thread_info] "i" (offsetof(struct task_struct, thread_info)), \
[pda_pcurrent] "i" (offsetof(struct x8664_pda, pcurrent)) \
: "memory", "cc" __EXTRA_CLOBBER)
![Page 35: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/35.jpg)
Shortest Remaining Time First (SRTF)
![Page 36: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/36.jpg)
Priority-based Scheduling
• UNIX
![Page 37: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/37.jpg)
Deadline-based Algorithms
![Page 38: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/38.jpg)
Proportional-Share Schedulers
![Page 39: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/39.jpg)
Lottery Scheduling• Project 1
![Page 40: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/40.jpg)
Work Conservation
![Page 41: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/41.jpg)
Reservation-based Schedulers
![Page 42: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/42.jpg)
Rate Regulation
![Page 43: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/43.jpg)
Hierarchical Schedulers
![Page 44: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/44.jpg)
Problem introduced by
I/O-bound processes
![Page 45: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/45.jpg)
Scheduler Considerations: Context-Switch
Overhead
![Page 46: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/46.jpg)
Scheduler Considerations:
Quantum Length
![Page 47: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/47.jpg)
Scheduler Considerations: Setting
Parameters
![Page 48: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/48.jpg)
Scheduler Considerations:CPU Accounting
![Page 49: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/49.jpg)
Scheduler Considerations:Time and Space Requirements
![Page 50: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/50.jpg)
Algorithm Evaluation
![Page 51: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/51.jpg)
A Look at the Linux CPU Scheduler
• Show a timer interrupt, blocking due to I/O etc.
![Page 52: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/52.jpg)
Threads
![Page 53: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/53.jpg)
Thread Libraries
![Page 54: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/54.jpg)
Thread or Process?
![Page 55: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/55.jpg)
Event-driven Programming
• Synchronous vs NS I/O
![Page 56: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/56.jpg)
Multi-processor Scheduling
![Page 57: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/57.jpg)
CPUs with Hyper-threading
![Page 58: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/58.jpg)
Process Synchronization
![Page 59: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/59.jpg)
Inter-process Communication
![Page 60: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/60.jpg)
Deadlocks
![Page 61: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/61.jpg)
System Boot-up
![Page 62: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/62.jpg)
Booting a Linux Kernel
![Page 63: Operating Systems CSE 411 CPU Management Sept. 15 2006 - Lecture 5 Instructor: Bhuvan Urgaonkar.](https://reader035.fdocuments.in/reader035/viewer/2022070323/56649da75503460f94a92eeb/html5/thumbnails/63.jpg)
• Next: Memory Management