summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--proj0.txt18
1 files changed, 16 insertions, 2 deletions
diff --git a/proj0.txt b/proj0.txt
index c4aa3dc..22939fc 100644
--- a/proj0.txt
+++ b/proj0.txt
@@ -34,6 +34,11 @@ TODO
34struct thread: 34struct thread:
35int64_t wakeup_tick ...absolute tick when to wake up the thread 35int64_t wakeup_tick ...absolute tick when to wake up the thread
36 36
37
38timer.c:
39static struct list wakeup_list ...list of processes waiting for an
40wakeup 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
59TODO 64Each thread has its own variable for saving its sleep period
65therefore no race conditions arise while setting the latter. Furthermore
66during the access to the static wakup_list, interrupts are disabled to prevent
67thread 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.
123TODO 132
133Outsourcing command separation from the kernel leads to a leaner
134less complex kernel implementation and reduces the kernel workload
135because tasks like searching for a command name in file system
136can be delegated to the shell.
137
124 138
125 SURVEY QUESTIONS 139 SURVEY QUESTIONS
126 ================ 140 ================