From e36b0359fc2561c1a1459764dbd443257e356863 Mon Sep 17 00:00:00 2001 From: Peter Ketscher Date: Thu, 19 Apr 2012 03:46:04 +0200 Subject: design document updated --- proj0.txt | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'proj0.txt') diff --git a/proj0.txt b/proj0.txt index c4aa3dc..22939fc 100644 --- a/proj0.txt +++ b/proj0.txt @@ -34,6 +34,11 @@ TODO struct thread: int64_t wakeup_tick ...absolute tick when to wake up the thread + +timer.c: +static struct list wakeup_list ...list of processes waiting for an +wakeup event and currently put to sleep + ---- ALGORITHMS ---- >> 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. >> A4: How are race conditions avoided when multiple threads call >> timer_sleep() simultaneously? -TODO +Each thread has its own variable for saving its sleep period +therefore no race conditions arise while setting the latter. Furthermore +during the access to the static wakup_list, interrupts are disabled to prevent +thread preemption. + >> A5: How are race conditions avoided when a timer interrupt occurs >> during a call to timer_sleep()? @@ -120,7 +129,12 @@ strtok() uses global data, so it is unsafe in threaded programs such as kernels. * Possible bugs in the code will either just break the shell or allow code execution with user privileges. Otherwise this could lead to a kernel oops or even worse code execution within the kernel. -TODO + +Outsourcing command separation from the kernel leads to a leaner +less complex kernel implementation and reduces the kernel workload +because tasks like searching for a command name in file system +can be delegated to the shell. + SURVEY QUESTIONS ================ -- cgit v1.2.3