Transcript
Sean Barker
Processes
1
Memory
I/O
Processor Processes, scheduling, synchronization
Allocation, protection, virtual memory
Disk management, filesystems, networking
Hardware OS Services
Sean Barker
Process Control Block (PCB)
2
Process Control Block (PCB)
Process State
PC
CPU registers
CPU scheduling info
List of open files
...
Sean Barker
Context Switching
3
Sean Barker
Process Execution States
4
Process State
Sean Barker
CPU Scheduling
5
Processes
CPU
Sean Barker
CPU and I/O Bursts
6
Process Behavior Long CPU burst
Short CPU burst Waiting for I/O
CPU-bound process
I/O-bound process
Sean Barker
Multilevel Feedback Queues
7
Sean Barker
CPU Scheduling Summary
First Come First Serve (FCFS)
Shortest Job First (SJF)
Shortest Remaining Time First (SRTF)
Round-Robin (RR)
Multilevel Feedback Queues (MLFQ)
... more advanced schedulers ...
8
Sean Barker
Threads
9
Sean Barker
Multithreaded Processes
10
Sean Barker
Thread APIs
11
POSIX Threads (pthreads): pthread_create(&tid, NULL, my_fun, ¶m); // thread runs my_fun
Windows Threads:ThreadHandle = CreateThread(NULL, 0, MyFun, &Param, 0, &ThreadID);
Java Threads:Thread t = new Thread(new MyRunnable(param));t.start(); // start the thread running MyRunnable.run()
Sean Barker
User-Level Threads
12
top related