Liste des Groupes | Revenir à ca embedded |
On 11/6/2024 3:25 PM, George Neuner wrote:You asked how best to handle these things. The answer is provide>
options in the scheduler and ensure that the options are (at least)
considered by the programmer by making them /required/ parameters.
If you don't like the number of parameters, pass them as a structure.
I object to the *complexity* that all those different potential
conditionals impose on the facility.
>
If you want a fancy/smart scheduler interface, build a *service*
that implements it and let *that* talk to the actual scheduler.
If the service fails, then any clients that RELY on it get screwed,
but the REAL scheduler still keeps working (for ITS clients)
>If you treat the tasks in a system as being flexible in their
scheduling (which is inherent in almost all multitasking systems...
you can't be assured when ANY task *actually* executes), then you
can't define hard limits as to how "late" something can happen.
What you're describing here is meta: it's a condition of utilizing the
scheduler in the 1st place, not a condition of triggering a scheduled
event.
Exactly. Why tell the scheduler how to respond to changes in the
environment -- changes that you can never completely anticipate
in designing an API.
>
Let the application figure out what "makes sense" for it.
I think what you may really /mean/ is dependency scheduling ... i.e.>
"this event depends on there being one or more other events already
scheduled".
No, it is a reflection of how "now" has changed from what the
developer THOUGHT "now" would be like when that line of code
(schedule(x)) was about to be executed.
>
E.g., the event_time+delta clearly reflects an assumption that the
previous event -- at event_time -- will have completed before the
next event occurs. Unless there is some other mechanism in place
to assure this, it is likely a faulty assumption.
schedule(event_time)
...
schedule(event_time+delta)
So, write the code ignorant of that possibility and address the
bug WHEN it manifests.
OR, redesign the implementation so that implicit expectation
is made more explicit. E.g., possibly require the first event
to set a flag to indicate that it HAS completed before you
allow the second event to proceed (even if both have been skewed
significantly in time).
The number and criticality of such dependencies can be unbounded - or>
at least unworkable to specify - and I don't think checking for them
belongs /in/ the scheduler or its API. If some program depends on
such meta knowledge of what is scheduled, it should have to keep track
of that itself.
That is my point. schedule(X) simply and unconditionally schedules X.
If the task abends BEFORE that line of code executes, then it is the
developer's job to figure out how <whatever> has been impacted by
that non-event. E.g., if it NEEDS to be scheduled, regardless, then
redesign the application to make that guarantee explicit and obvious.
>
If the scheduled time PASSES before that line of code executes,
then, similarly, it is up to the developer to decide how it
should be handled. E.g., if the activity only makes sense at
that particular point in time, then you don't want to schedule
it if that point in time is no longer attainable.
>
So, schedule() is freed from being concerned with these issues.
Scheduling in a complex system is NOT SIMPLE and it never has been:>
whole books have been written about it. The overwhelming majority of
events likely will require only a small subset of the scheduler's
options, but the scheduler itself must deal with the most complex case
possible.
This is why it is easier (to get "right") a simple, unconditional
syscall that doesn't have to evaluate other conditions -- ASSUME the
caller had already done that work and DECIDED that the event should
be scheduled. So, you ("I") can concentrate on JUST getting the event
scheduled.
Les messages affichés proviennent d'usenet.