Subject:
|
Re: multiplexor and legOS
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Tue, 5 Feb 2002 18:32:32 GMT
|
Viewed:
|
2521 times
|
| |
| |
In lugnet.robotics.rcx.legos, Michael Ash writes:
>
> Most people's legOS kernels will be compiled so msleep uses wait_event. I
> haven't looked at the code, but my understanding of how wait_event works
> is that whenever that thread becomes eligible to execute, your even
> function is called. Depending on what it returns, your thread either
> starts running, or goes back to sleep until it becomes eligible to run
> again. The 20ms task switch time means that your event function could be
> running only every 20ms (or more, if there are many other tasks running
> and taking up CPU time). I suppose it could be less that 20ms under the
> right conditions, but apparently that can't be relied on.
>
> Here's a crazy idea. Have some kind of accurate_msleep which checks every
> time the millisecond interrupt goes off, and switches to the thread in
> question right away. Could this work as a solution for when accurate
> timing is needed?
Actually, something like this has been documented and done by Pedersen,
Christensen, Rasmussen ("Prioritized Interrupts in LegOS"). They actually
document the problem of sensor misses related to task management,
significantly reducing the problem by introducing an interrupt structure
around just what you mentioned, the 1ms timer interrupt (instead of the A/D
handler which gets sensor readings 6 to 8 times per msec, thus limiting
available processing). There are two costs to this though: a 15% increase in
CPU workload (imagine what it would be for an A/D inplementation) and a
restriction of one sensor per thread. Neither is very costly, in the long
run. The only other problem is that they have retained high priority thread
priority, meaning that a thread with higher priority can still trump a
sensor interrupt. Nonetheless, their results are spectacular (from 36%-100%
to 0-10% misses).
The questions now are 1) where is the source code for the modified kernel
(publicly available, anyway)? 2) what modifications to this would be
required in order to implement the necessary sensor multiplexing of a sensor
port with this multiplexer attached?
Robert Templeton
|
|
Message has 1 Reply: | | Re: multiplexor and legOS
|
| (...) I'm just checking this thing out. You can look at: (URL) more information. Unfortunately, I got the .ps description file but not the source code patch file. A mail asking for it is on it's way ;) Mike (23 years ago, 5-Feb-02, to lugnet.robotics.rcx.legos)
|
Message is in Reply To:
| | Re: multiplexor and legOS
|
| (...) Most people's legOS kernels will be compiled so msleep uses wait_event. I haven't looked at the code, but my understanding of how wait_event works is that whenever that thread becomes eligible to execute, your even function is called. (...) (23 years ago, 5-Feb-02, to lugnet.robotics.rcx.legos)
|
19 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|