diff options
| author | manuel <manuel@mausz.at> | 2012-03-26 22:05:09 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2012-03-26 22:05:09 +0200 |
| commit | 1a39d0619947a0a3cda8322e5856975ba46c602d (patch) | |
| tree | 411c8ee27fd75756dd73e52ff1c622dd2c5c9356 /proj0.txt | |
| parent | 11c1519a12cdae1ce05d31a6e389a103259c6c93 (diff) | |
| download | progos-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.txt | 11 |
1 files changed, 8 insertions, 3 deletions
| @@ -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 | ||
| 34 | struct thread: | 34 | struct thread: |
| 35 | int64_t alarm_tick ...absolute tick when to trigger an alarm event | 35 | int64_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 | ||
| 42 | TODO | 42 | In case of a positive tick value we calculate the tick when to awake the |
| 43 | current thread and store that inside the per thread structure. Afterwards | ||
| 44 | we disable interrupts and insert the thread into our wakup list which is | ||
| 45 | sorted by wakeup-tick in ascending order. Finally we block the thread | ||
| 46 | and 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 | ||
| 47 | TODO | 51 | We sort our alarm/wake-up list by wakeup-tick value in ascending order. |
| 52 | Thus we can return as soon as the first thread doesn't need to get unblocked. | ||
| 48 | 53 | ||
| 49 | ---- SYNCHRONIZATION ---- | 54 | ---- SYNCHRONIZATION ---- |
| 50 | 55 | ||
