Subject:
|
Re: Polling sensor values with wait_event
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Wed, 27 Nov 2002 02:36:34 GMT
|
Viewed:
|
3233 times
|
| |
| |
Thomas,
You are mostly correct. However, keep in mind that tasks with the same
priority get checked in turn. The first task in the priority chain does not
get undo precedence over the others in the same priority level.
Example: Tasks A, B and C all have the same (highest) priority. The
scheduler will check A and, for the sake of this example, execute A. When
the timeslice is expired, the scheduler will then start by checking task B
(and possibly execute it)... then when the timeslice is expired, the task
scheduler will start by checking task C... Only after B and C have had their
"turn" will the scheduler begin looking at A again. Obviously if A, B and C
are all sleeping, then the next priority level is checked.
Also, if tasks A and B are sleeping then C gets checked after every
timeslice.
I hope this helps. Oh, but to answer your question, yes... the wakeup
function may not be called quickly enough to have registered the event.
My suggested solution would be to have one high priority task which records
events into a log... then the bulk of the work could be done in a couple
lower priority tasks that use the log to detect events. I am not sure if
this will help.
// Joe
"Thomas Gysi" <t.gysi@fh-aargau.ch> wrote in message
news:3DE3A396.6020806@fh-aargau.ch...
> Hello all,
>
> Is it true that the wakeup function is only checked once every timeslice
> and only for the process that has the highest priority and is at the
> front of the priority chain? For example, a process k is waiting on the
> wakeup function y wich evaluates true, and it is at at the end of the
> priority chain on the highest priority. Two other process are before k,
> do they get executed before y is evaluated and may now be false? In this
> case the event where y evaluated to true would have been ignored.
> The code I am referring to is in tm.c in the function tm_scheduler after
> the comment: "find next process willing to run".
>
> Thanks for your comments
>
> Thomas
>
|
|
Message has 1 Reply:
Message is in Reply To:
| | Polling sensor values with wait_event
|
| Hello all, Is it true that the wakeup function is only checked once every timeslice and only for the process that has the highest priority and is at the front of the priority chain? For example, a process k is waiting on the wakeup function y wich (...) (22 years ago, 26-Nov-02, to lugnet.robotics.rcx.legos)
|
4 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
|
|
|
|