summaryrefslogtreecommitdiffstats
path: root/proj0.txt
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2012-03-26 22:05:09 +0200
committermanuel <manuel@mausz.at>2012-03-26 22:05:09 +0200
commit1a39d0619947a0a3cda8322e5856975ba46c602d (patch)
tree411c8ee27fd75756dd73e52ff1c622dd2c5c9356 /proj0.txt
parent11c1519a12cdae1ce05d31a6e389a103259c6c93 (diff)
downloadprogos-1a39d0619947a0a3cda8322e5856975ba46c602d.tar.gz
progos-1a39d0619947a0a3cda8322e5856975ba46c602d.tar.bz2
progos-1a39d0619947a0a3cda8322e5856975ba46c602d.zip
- rename alarm list/tick to wakeup list/tick
- order wakeup list by wakeup tick in ascending order which allows to bail out early inside timer_interrupt
Diffstat (limited to 'proj0.txt')
-rw-r--r--proj0.txt11
1 files changed, 8 insertions, 3 deletions
diff --git a/proj0.txt b/proj0.txt
index 8cdfb49..7284b9e 100644
--- a/proj0.txt
+++ b/proj0.txt
@@ -32,19 +32,24 @@ TODO
32>> enumeration. Identify the purpose of each in 25 words or less. 32>> enumeration. Identify the purpose of each in 25 words or less.
33 33
34struct thread: 34struct thread:
35int64_t alarm_tick ...absolute tick when to trigger an alarm event 35int64_t wakeup_tick ...absolute tick when to wake up the thread
36 36
37---- ALGORITHMS ---- 37---- ALGORITHMS ----
38 38
39>> A2: Briefly describe what happens in a call to timer_sleep(), 39>> A2: Briefly describe what happens in a call to timer_sleep(),
40>> including the effects of the timer interrupt handler. 40>> including the effects of the timer interrupt handler.
41 41
42TODO 42In case of a positive tick value we calculate the tick when to awake the
43current thread and store that inside the per thread structure. Afterwards
44we disable interrupts and insert the thread into our wakup list which is
45sorted by wakeup-tick in ascending order. Finally we block the thread
46and restore the interrupt value.
43 47
44>> A3: What steps are taken to minimize the amount of time spent in 48>> A3: What steps are taken to minimize the amount of time spent in
45>> the timer interrupt handler? 49>> the timer interrupt handler?
46 50
47TODO 51We sort our alarm/wake-up list by wakeup-tick value in ascending order.
52Thus we can return as soon as the first thread doesn't need to get unblocked.
48 53
49---- SYNCHRONIZATION ---- 54---- SYNCHRONIZATION ----
50 55