diff options
Diffstat (limited to 'proj0.txt')
| -rw-r--r-- | proj0.txt | 18 |
1 files changed, 16 insertions, 2 deletions
| @@ -34,6 +34,11 @@ TODO | |||
| 34 | struct thread: | 34 | struct thread: |
| 35 | int64_t wakeup_tick ...absolute tick when to wake up the thread | 35 | int64_t wakeup_tick ...absolute tick when to wake up the thread |
| 36 | 36 | ||
| 37 | |||
| 38 | timer.c: | ||
| 39 | static struct list wakeup_list ...list of processes waiting for an | ||
| 40 | wakeup event and currently put to sleep | ||
| 41 | |||
| 37 | ---- ALGORITHMS ---- | 42 | ---- ALGORITHMS ---- |
| 38 | 43 | ||
| 39 | >> A2: Briefly describe what happens in a call to timer_sleep(), | 44 | >> A2: Briefly describe what happens in a call to timer_sleep(), |
| @@ -56,7 +61,11 @@ Thus we can return as soon as the first thread doesn't need to get unblocked. | |||
| 56 | >> A4: How are race conditions avoided when multiple threads call | 61 | >> A4: How are race conditions avoided when multiple threads call |
| 57 | >> timer_sleep() simultaneously? | 62 | >> timer_sleep() simultaneously? |
| 58 | 63 | ||
| 59 | TODO | 64 | Each thread has its own variable for saving its sleep period |
| 65 | therefore no race conditions arise while setting the latter. Furthermore | ||
| 66 | during the access to the static wakup_list, interrupts are disabled to prevent | ||
| 67 | thread preemption. | ||
| 68 | |||
| 60 | 69 | ||
| 61 | >> A5: How are race conditions avoided when a timer interrupt occurs | 70 | >> A5: How are race conditions avoided when a timer interrupt occurs |
| 62 | >> during a call to timer_sleep()? | 71 | >> during a call to timer_sleep()? |
| @@ -120,7 +129,12 @@ strtok() uses global data, so it is unsafe in threaded programs such as kernels. | |||
| 120 | * Possible bugs in the code will either just break the shell or allow code | 129 | * Possible bugs in the code will either just break the shell or allow code |
| 121 | execution with user privileges. Otherwise this could lead to a kernel oops | 130 | execution with user privileges. Otherwise this could lead to a kernel oops |
| 122 | or even worse code execution within the kernel. | 131 | or even worse code execution within the kernel. |
| 123 | TODO | 132 | |
| 133 | Outsourcing command separation from the kernel leads to a leaner | ||
| 134 | less complex kernel implementation and reduces the kernel workload | ||
| 135 | because tasks like searching for a command name in file system | ||
| 136 | can be delegated to the shell. | ||
| 137 | |||
| 124 | 138 | ||
| 125 | SURVEY QUESTIONS | 139 | SURVEY QUESTIONS |
| 126 | ================ | 140 | ================ |
