|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] Re: [PATCH] add timeouts to mini-os
Which functionalities would you like to see that are currently
missing?
The timers I was thinking about would follow Xen/Linux model. For
each timer you would need to specify the following:
- a timeout (timestamp)
- a handler function
- if the timer is one-shot or periodic
Such timers are more flexible, but the handler function is limited in
functionality by the fact that you are running in the interrupt
context. Since Mini-OS doesn't maintain much state (that could be
modified by a timeout timer), the only thing you would be likely
doing is waking up a thread/set of threads. It therefore follows that
your implementation does the same thing, but it's shorter/cleaner. In
particular there is no need for timer heap or a similar datastructure.
(There are few shortcomings of my implementation that I'm well
aware of
myself. For instance, I think it would be more efficient to unlink
blocked
threads from the ready queue and keep the ones with pending
timeouts in a
"timeout" queue, sorted by ascending expiry date. That way, it
wouldn't be
necessary to walk the entire ready queue all the time to see if any
timeouts
have expired: it would suffice to just look at the head of the
timeout queue.
However, my goal was to keep things simple and to not change more than
absolutely necessary.)
That's fine. I decided against separate lists for runnable/blocked
threads for exactly the same reasons. Mini-OS is not about
scalability, keeping the things as simple as possible is the main
priority.
Cheers
Gregor
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|