Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch.embedded > #23662

Re: Forewarning of resource inadequacies

From Don Y <blockedofcourse@foo.invalid>
Newsgroups comp.arch.embedded
Subject Re: Forewarning of resource inadequacies
Date 2016-04-15 12:31 -0700
Organization A noiseless patient Spider
Message-ID <nerfcp$4a6$1@dont-email.me> (permalink)
References (1 earlier) <op.yfuqawrbj0diun@thanatos.lan> <nelitr$l86$1@dont-email.me> <op.yfwtm7ojj0diun@thanatos.lan> <neo6fr$rha$1@dont-email.me> <op.yfynetfqj0diun@thanatos.lan>

Show all headers | View raw


On 4/15/2016 5:24 AM, Boudewijn Dijkstra wrote:
> Op Thu, 14 Apr 2016 15:37:15 +0200 schreef Don Y <blockedofcourse@foo.invalid>:
>> On 4/14/2016 5:43 AM, Boudewijn Dijkstra wrote:
>>> Op Wed, 13 Apr 2016 15:51:10 +0200 schreef Don Y <blockedofcourse@foo.invalid>:
>>>> On 4/13/2016 2:36 AM, Boudewijn Dijkstra wrote:
>>>>
>>>> [...] the problem is not SURPRISING him at some later time that an
>>>> action he (appeared to) successfully initiated has not completed as he
>>>> had expected. [...]
>>>>
>>>> This suggests locking those resources at the start of the operation.
>>>
>>> No, it suggests reserving them. For a complex operation, it suggests locking
>>> until the exact resource needs have been determined.
>>
>> This ties up those resources for the length of the operation -- preventing
>> other similar (unprivileged) tasks from using those resources even if their
>> use may be brief and transitory -- not jeopardizing to the execution of this
>> first task.
>
> It depends how fine-grained these tasks can specify their resource usage.

They can only specify their needs over the run of the entire job.
I.e., can't say "I need this for X minutes, then that for the next
Y minutes, etc."

So, a job that might "think" for 10 minutes and then consume gobs
of disk in the last 30 seconds looks the same as one that eats
the same amount of disk at a steady pace.

For tasks that MUST run, you have to treat their requirements
in a block as you can't (usually) bias their scheduling wrt other
similar tasks to exploit any complementary overlaps.

For a "hard-wired" implementation, you can embed *your* knowledge of
the resource interplay of different "consumers" into the use of those
resources.  E.g., to emulate that sort of capability, I have to wrap
complementary tasks into a single "pseudo-task" and specify the
resource requirements of the MAX(task1, task2, task...) for that
pseudo-task; then, ensure that I only activate one of them at a time.

[There's no way for me to tell the system:  this task requires XYZ
but only if neither task A nor B are active -- otherwise it requires 0.]

>> I.e., that's the nature of the problem:
>> - if you want to be able to tell the user that his task *will* execute,
>>    then you have to impose the same sorts of reservations that you would
>>    for privileged tasks (i.e., at the expense of other tasks that the user may
>>    want to execute -- you can't risk "gambling" that things will work out
>>    to the satisfaction of all his tasks)
>
> Exactly, you can't predict the future without knowing what will happen.

And, neither can the user!

But, the machine won't get emotional if something it wanted to do
COULDN'T complete.  A user, OTOH, can become annoyed if "surprised"
at some later time ("Why didn't you tell me there wasn't enough
disk space BEFORE you started working on it?")

>> - if you want to maximize potential utility of resources (for an indeterminate
>>    set of possible user tasks), then you can't give assurances at task
>>    activation -- because you can't (don't want to) follow up by imposing
>>    those restrictions on the resource use
>
> I was thinking it would be perfectly fine to impose those restrictions for
> cheap resources like e.g. disk space. If reporting about resources inadequacies
> is important, then the task itself is important and deserves special treatment.

That's specious reasoning.  You're equating "important" and "convenient".

If I try to move a folder onto a thumb drive and, some minutes later, get
informed that there is no space left on the device, it's INCONVENIENT;
I now have to move everything back and find a bigger target drive.
I might be able to defer that activity for days or weeks (I may have to
purchase a larger thumb drive!) -- hardly "important".

Or, if I want it done immediately, I may have to rearrange what's on the
thumb drive (make space) *or* consider cutting the folder into two
logical pieces that "make sense" to move onto two different media.

OTOH, if its a laptop running on battery and that battery is nearly depleted,
it is "important" that everything be shut down in an orderly fashion if
I don't want to risk losing something.  More significant than "convenient"!

I can deal with "important" by simply reserving resources in the admittance
process.  I'd like NOT to have to treat everything that might become
"inconvenient" as "important"!

>> I.e., the potential for maximizing utilization comes with the inherent risk
>> of a potential (future) shortage; if you go that route, you must be willing
>> to inform the user of that possibility WHEN (if) it later occurs -- even if
>> that is impractical.
>>
>> That's the "no free lunch" aspect.
>>
>> So, even adding heuristics to implement "partial" gambling (to maximize
>> utilization) -- i.e., make those guarantees for long (whatever that
>> means) operations where the user may walk away, lose interest or forget
>> about the task's activation but NOT for short-lived operations where
>> you HOPE the user is still around for any potential notification.
>>
>> I.e., the user doesn't have a consistent interface/relationship with the
>> system:  sometimes he KNOWS that a task will complete simply because it
>> was accepted and started; other times, he might be surprised to be
>> BELATEDLY (though not *too* late?) informed that a task that HAD started
>> won't be able to complete.
>
> I think there's one thing at play here that you haven't explicitly mentioned:
> confidence factor. More confidence is less surprise. During a task, the system
> could report its confidence of completion.

You're assuming you have the user's attention for that entire period.

If you activate a "print" job, you typically don't sit there watching
pages come out of the printer, one at a time, until the job is
finished.  You may move on to some other task -- perhaps not even
involving The Computer.  Or, depart (go to bed, etc.).

If the printer runs out of supplies (paper/ink) at some point prior to
completion, you are disappointed/annoyed when you eventually go to pick
up your FINISHED job.

If the printer (and print service) doesn't let you resume an interrupted
(paper out) job, you have to restart the job -- from the point at which
it prematurely stopped.  If the printer *thinks* it did a great job
printing but you notice all sorts of visual artifacts on the pages
(smearing/smudging/dropouts/etc.) then there's a significant difference
of opinion as to whether or not the job was actually *done*!  :>

>> The user has to "learn" how to differentiate between these two types of
>> tasks.  Or, the system must be able to tell him (at or prior to
>> activation).
>>
>> *Or*, the user must be given the OPTION of "that guarantee":
>>       "This is going to take a while to complete.  I can guarantee
>>       completion but only at the expense of other tasks that you may
>>       elect to activate (or, have previously activated 'conditionally').
>>       Would you like to take advantage of this capability?"
>
> So: start job at 100% confidence.

And what do I do when the user walks away THINKING everything is fine?
Only to return some time later to see "confidence = -10; job aborted"?

The problem is coming to "some understanding" with the user regarding
the quality of service provided and expected.  And, "being fair" in
stating the realities involved.  I.e., to claim 80% confidence but
REPEATEDLY fail to complete the task can only be seen as disingenuous.
As the machine can't predict the future, it shouldn't lower its confidence
estimation:  "past performance is no indication of FUTURE performance".

But, the user (an emotional being) won't see it that way.

>> But, again, this makes some tasks different (in terms of what the user
>> experiences when activating them).  And, no way for the user to know
>> which tasks those might be (unless I consistently ask -- even for short-lived
>> tasks that will PROBABLY be able to complete unimpeded).
>
> If the tasks are predefined, a rough confidence factor could be assigned to them.

Would you use anything on your PC if it announced that it had anything
less than 100% confidence that it would complete?

How do I assign a confidence factor to a user-written script?  Track
it's performance statistically and report THAT each time it is started?

>> It's a sort of:
>>     "Are you sure you want to do that?"

I think there are two "solutions":
- give hard and fast guarantees (then, use the mechanisms available to
   ensure these are met)
- give NO guarantees, but allow tasks to run indefinitely (no deadlines)
   so a task has never really "failed"/aborted!  (it just keeps waiting
   in the naive hope that the resource it needs WILL become available!)

Back to comp.arch.embedded | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Forewarning of resource inadequacies Don Y <blockedofcourse@foo.invalid> - 2016-04-07 14:10 -0700
  Re: Forewarning of resource inadequacies George Neuner <gneuner2@comcast.net> - 2016-04-08 07:08 -0400
    Re: Forewarning of resource inadequacies Don Y <blockedofcourse@foo.invalid> - 2016-04-08 11:58 -0700
      Re: Forewarning of resource inadequacies George Neuner <gneuner2@comcast.net> - 2016-04-11 01:47 -0400
        Re: Forewarning of resource inadequacies Don Y <blockedofcourse@foo.invalid> - 2016-04-11 02:06 -0700
          Re: Forewarning of resource inadequacies George Neuner <gneuner2@comcast.net> - 2016-04-12 03:22 -0400
            Re: Forewarning of resource inadequacies Don Y <blockedofcourse@foo.invalid> - 2016-04-12 04:22 -0700
              Re: Forewarning of resource inadequacies Dimiter_Popoff <dp@tgi-sci.com> - 2016-04-12 15:39 +0300
                Re: Forewarning of resource inadequacies Don Y <blockedofcourse@foo.invalid> - 2016-04-12 07:55 -0700
  Re: Forewarning of resource inadequacies "Boudewijn Dijkstra" <sp4mtr4p.boudewijn@indes.com> - 2016-04-13 11:36 +0200
    Re: Forewarning of resource inadequacies Don Y <blockedofcourse@foo.invalid> - 2016-04-13 06:51 -0700
      Re: Forewarning of resource inadequacies "Boudewijn Dijkstra" <sp4mtr4p.boudewijn@indes.com> - 2016-04-14 14:43 +0200
        Re: Forewarning of resource inadequacies Don Y <blockedofcourse@foo.invalid> - 2016-04-14 06:37 -0700
          Re: Forewarning of resource inadequacies "Boudewijn Dijkstra" <sp4mtr4p.boudewijn@indes.com> - 2016-04-15 14:24 +0200
            Re: Forewarning of resource inadequacies Don Y <blockedofcourse@foo.invalid> - 2016-04-15 12:31 -0700

csiph-web