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


Groups > comp.arch.embedded > #23606

Re: Forewarning of resource inadequacies

From "Boudewijn Dijkstra" <sp4mtr4p.boudewijn@indes.com>
Newsgroups comp.arch.embedded
Subject Re: Forewarning of resource inadequacies
Date 2016-04-13 11:36 +0200
Organization Indes - IDS B.V.
Message-ID <op.yfuqawrbj0diun@thanatos.lan> (permalink)
References <ne6icd$o8q$1@dont-email.me>

Show all headers | View raw


Op Thu, 07 Apr 2016 23:10:04 +0200 schreef Don Y
<blockedofcourse@foo.invalid>:
> *IN GENERAL*, what dogma would you suggest

I suggest rejecting all dogma. (I can suggest doctrines, however.)

> regarding addressing
> potential ("current") resource inadequacies when starting a task
> (or, offering that capability *to* start that task to a user)?

Depends who is initiating the task and who is responsible for resource  
availability.

1. In an open user-controlled environment, leave it to the user. This
means giving the user the tools to determine resource usage and the option
to shoot himself in the foot.
2. In more closed/rigid environments, make a best effort to inform the
user. If system damage is possible, prevent it.

> Keep in mind that resource availability varies before, during and
> after a potential task/activity is initiated.  And, a particular
> activity may result in other activities (automatically started
> or likely to *want* to be started -- by the user).
>
> E.g., if you were asked to copy a file, you'd probably stat() the
> file to ascertain its size (*hope* that size remains constant
> during the following operation)

Or lock the file.

> and check to be sure you have that
> much free-space on the target.

Or reserve the space.

> I.e., the copy operation would
> tend to be fast enough that the user couldn't remedy a "no space
> on device" error before it was signaled.

What if you're recursively copying thousands of files from potentially
multiple partitions to potentially multiple partitions potentially
containing hardlinks and/or symlinks?

> OTOH, if the transport medium was of sufficiently low bandwidth,
> you could allow the operation to start and warn the user that
> he/she WILL run out of space at the target *if* nothing changes
> (the implication being that the user should be that agent of change).

You could, but what if the user's mom calls right when he is about free  
some space? It should be possible to pause the operation.

> The 1960's approach, of course, is just to naively start the operation
> and then have it abend when it hits that brick wall!
>
> Note that each action that the user takes implicitly consumes resources
> and, as such, can hinder other actions that he/she may want to take.

As with everything in life. Your questions are as old as human society.

> And, that your device can also have autonomous resource needs that
> are incurred alongside the user's actions (e.g., daemons).
>
> Do you, for example, let the user consume battery in a futile attempt
> to perform some operation -- and end up jeopardizing his ability to
> do some more valuable operation later (e.g., back up his device before
> power fails)?

If you already know that the user is likely to perform a backup, then the  
resources for that should already be reserved before "some operation" can  
be initiated. In this case, there is no jeopardy.

> Again, these are only examples.  The question is what criteria do you use
> for alerting (and/or inhibiting!) the user when you know that it is  
> likely
> that he won't be able to perform the desired task WITH THE SYSTEM IN ITS
> CURRENT STATE -- and *when* do you impose those notifications?




-- 
(Remove the obvious prefix to reply privately.)
Gemaakt met Opera's e-mailprogramma: http://www.opera.com/mail/

Back to comp.arch.embedded | Previous | Next — Previous in thread | Next 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