From 1a39d0619947a0a3cda8322e5856975ba46c602d Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 26 Mar 2012 22:05:09 +0200 Subject: - 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 --- proj0.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'proj0.txt') diff --git a/proj0.txt b/proj0.txt index 8cdfb49..7284b9e 100644 --- a/proj0.txt +++ b/proj0.txt @@ -32,19 +32,24 @@ TODO >> enumeration. Identify the purpose of each in 25 words or less. struct thread: -int64_t alarm_tick ...absolute tick when to trigger an alarm event +int64_t wakeup_tick ...absolute tick when to wake up the thread ---- ALGORITHMS ---- >> A2: Briefly describe what happens in a call to timer_sleep(), >> including the effects of the timer interrupt handler. -TODO +In case of a positive tick value we calculate the tick when to awake the +current thread and store that inside the per thread structure. Afterwards +we disable interrupts and insert the thread into our wakup list which is +sorted by wakeup-tick in ascending order. Finally we block the thread +and restore the interrupt value. >> A3: What steps are taken to minimize the amount of time spent in >> the timer interrupt handler? -TODO +We sort our alarm/wake-up list by wakeup-tick value in ascending order. +Thus we can return as soon as the first thread doesn't need to get unblocked. ---- SYNCHRONIZATION ---- -- cgit v1.2.3