Scheduling 3 / Threads
1
Scheduling 3 / Threads 1 last time shortest job fjrst/shortest - - PowerPoint PPT Presentation
Scheduling 3 / Threads 1 last time shortest job fjrst/shortest remaining time fjrst response time optimizing SJF without preemption SRTF with preemption multi-level feedback scheduling process uses whole quantum? move down in
1
2
3
4
4
5
6
7
8
9
9
10
10
10
11
11
12
12
12
12
13
13
13
13
14
15
15
16
17
18
19
20
ready deadline
ready deadline
ready deadline
21
ready deadline ready deadline ready deadline
22
ready deadline ready deadline ready deadline
23
ready deadline ready deadline ready deadline
24
25
26
27
28
// Per-process state struct proc { uint sz; // Size of process memory (bytes) pde_t* pgdir; // Page table char *kstack; // Bottom of kernel stack for this process enum procstate state; // Process state int pid; // Process ID struct proc *parent; // Parent process struct trapframe *tf; // Trap frame for current syscall struct context *context; // swtch() here to run process void *chan; // If non-zero, sleeping on chan int killed; // If non-zero, have been killed struct file *ofile[NOFILE]; // Open files struct inode *cwd; // Current directory char name[16]; // Process name (debugging) };
29
// Per-process state struct proc { uint sz; // Size of process memory (bytes) pde_t* pgdir; // Page table char *kstack; // Bottom of kernel stack for this process enum procstate state; // Process state int pid; // Process ID struct proc *parent; // Parent process struct trapframe *tf; // Trap frame for current syscall struct context *context; // swtch() here to run process void *chan; // If non-zero, sleeping on chan int killed; // If non-zero, have been killed struct file *ofile[NOFILE]; // Open files struct inode *cwd; // Current directory char name[16]; // Process name (debugging) };
29
30
31
32
32
33
34
35
35
35
35
36
37
38
39
40
41
41
42
42
43
43
44
45
45
46
47
48
49
50
51
52
53
54
55
56
57
58
58
58
59
60
61
62
62
63
64
64
65
n
66
67
67
67
67
67
67
68
69