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


Groups > comp.arch.embedded > #28481

Re: How to avoid a task not executed in a real-time OS?

From David Brown <david.brown@hesbynett.no>
Newsgroups comp.arch.embedded
Subject Re: How to avoid a task not executed in a real-time OS?
Date 2019-01-23 08:57 +0100
Organization A noiseless patient Spider
Message-ID <q296pg$2lm$1@dont-email.me> (permalink)
References <f2f8fe2e-e554-4a13-b28c-b918604405fd@googlegroups.com> <q26jm1$g0j$1@dont-email.me> <gapf65F5r3aU1@mid.dfncis.de>

Show all headers | View raw


On 22/01/2019 22:10, Hans-Bernhard Bröker wrote:
> Am 22.01.2019 um 09:19 schrieb David Brown:
>> On 21/01/2019 13:40, Robert Willy wrote:
>>> Hi,
>>> I was asked the question in the title some time ago. I had some real-time
>>> embedded system experience but with RTOS. A watch-dog can avoid a task not
>>> called in a real-time system. But in a RTOS, what is the right answer for it?
>>
>> I have heard the use of watchdogs as being like hitting a dead man on
>> the head with a hammer in the hope that it will wake him.
> 
> That's overstating it teeny little bit. ;-)
> 
> It's more like hitting a newly dead heart with a hefty jolt of
> electricity to possibly make it restart --- a procedure that is quite
> definitely not recommended to be used on a non-dead one.

Perhaps.  But like a defibrillator, the watchdog does nothing to deal
with the actual cause of the problem.

> 
> And just like the bite of a watchdog, that sometimes actually does work.
> 
>> If the problem is in software, however, it will just lead to the
>> same situation again and again.
> That's by no means certain.  It all depends on how it happened that the
> software got itself stuck in a situation that didn't occur during
> testing (or the software would never have been released into the wild,
> right?)  But somehow, right now it did.
> 
> If a e.g. once-in-a-blue-moon "forbidden" excession of design
> limitations on some input was the reason, a watch-dog reset cures the
> problem until the next event of that kind --- i.e. possibly forever.
> 

We can say without doubt that the watchdog does not cure the problem.
If software causes a hang that triggers the watchdog, there is a bug in
the software.  That applies regardless of how it happened, how good or
bad testing you had, what the input values were, etc.  (Note that if
something exceeded /specified/ design limitations, then that is outside
the realm of the software.)  Since the watchdog does not magically fix
the software, the problem remains.

Clearly, not all systems need the same level of quality, reliability,
and robustness.  You don't design and test your "amusing" singing
birthday card to the same levels as you do for your submarine control
system.  And so sometimes, a watchdog reset on software hang is a good
enough way to handle the symptoms of some kinds of software bugs.  You
balance the cost of the unreliability against the cost of fixing it -
engineering is about making things good enough, not perfect.

But you do need to be aware of the watchdog actually does, and does not
do.  Some developers use it as a crutch to avoid the effort of writing
correct code, or testing appropriately.  "If there is an error on the
communication line, it will lead to a timeout - the watchdog will reset
the system, so that's fine."  "The tasks will only have a conflict and a
deadlock if the user presses the button at the same time as the screen
is updating - that is unlikely to happen, and the watchdog will fix it
if it does".  Some use it as a crutch to avoid debugging and fixing
problems.  "The software hung during testing, but the watchdog restarted
it fine.  We don't think it will happen at the customer's site."

Or "A watch-dog can avoid a task not called in a real-time system", as
the OP claimed.


So that does /not/ mean I don't recommend a watchdog (though frequently
I do not enable them - I'd rather the customer reported the problem so
we can fix it properly).  You just have to know /why/ you have a
watchdog, and use it appropriately.

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


Thread

How to avoid a task not executed in a real-time OS? Robert Willy <rxjwg98@gmail.com> - 2019-01-21 04:40 -0800
  Re: How to avoid a task not executed in a real-time OS? John Speth <johnspeth@yahoo.com> - 2019-01-21 06:27 -0800
  Re: How to avoid a task not executed in a real-time OS? Stef <stef33d@yahooI-N-V-A-L-I-D.com.invalid> - 2019-01-21 17:55 +0100
  Re: How to avoid a task not executed in a real-time OS? Richard Damon <Richard@Damon-Family.org> - 2019-01-21 13:05 -0500
    Re: How to avoid a task not executed in a real-time OS? upsidedown@downunder.com - 2019-01-22 08:05 +0200
  Re: How to avoid a task not executed in a real-time OS? Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2019-01-21 22:44 +0100
  Re: How to avoid a task not executed in a real-time OS? David Brown <david.brown@hesbynett.no> - 2019-01-22 09:19 +0100
    Re: How to avoid a task not executed in a real-time OS? Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2019-01-22 22:10 +0100
      Re: How to avoid a task not executed in a real-time OS? Dave Nadler <drn@nadler.com> - 2019-01-22 13:28 -0800
      Re: How to avoid a task not executed in a real-time OS? David Brown <david.brown@hesbynett.no> - 2019-01-23 08:57 +0100
        Re: How to avoid a task not executed in a real-time OS? Paul Rubin <no.email@nospam.invalid> - 2019-01-23 13:13 -0800
          Re: How to avoid a task not executed in a real-time OS? David Brown <david.brown@hesbynett.no> - 2019-01-24 08:31 +0100
  Re: How to avoid a task not executed in a real-time OS? George Neuner <gneuner2@comcast.net> - 2019-01-22 05:01 -0500
  Re: How to avoid a task not executed in a real-time OS? StateMachineCOM <statemachineguru@gmail.com> - 2019-01-28 07:17 -0800
    Re: How to avoid a task not executed in a real-time OS? "A.P.Richelieu" <aprichelieu@gmail.com> - 2019-01-28 20:15 +0100
      Re: How to avoid a task not executed in a real-time OS? StateMachineCOM <statemachineguru@gmail.com> - 2019-01-28 12:31 -0800
        Re: How to avoid a task not executed in a real-time OS? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2019-01-28 16:22 -0500
          Re: How to avoid a task not executed in a real-time OS? Clifford Heath <no.spam@please.net> - 2019-01-29 10:17 +1100
            Re: How to avoid a task not executed in a real-time OS? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2019-01-29 10:08 -0500
              Re: How to avoid a task not executed in a real-time OS? StateMachineCOM <statemachineguru@gmail.com> - 2019-01-29 09:30 -0800
                Re: How to avoid a task not executed in a real-time OS? Tom Gardner <spamjunk@blueyonder.co.uk> - 2019-01-29 18:22 +0000
                Re: How to avoid a task not executed in a real-time OS? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2019-01-29 13:50 -0500
                Re: How to avoid a task not executed in a real-time OS? Clifford Heath <no.spam@please.net> - 2019-01-30 09:45 +1100
                Re: How to avoid a task not executed in a real-time OS? Tom Gardner <spamjunk@blueyonder.co.uk> - 2019-01-30 00:56 +0000
          Re: How to avoid a task not executed in a real-time OS? Reinhardt Behm <rbehm@hushmail.com> - 2019-01-30 13:32 +0800
        Re: How to avoid a task not executed in a real-time OS? "A.P.Richelieu" <aprichelieu@gmail.com> - 2019-01-30 19:07 +0100
  Re: How to avoid a task not executed in a real-time OS? StateMachineCOM <statemachineguru@gmail.com> - 2019-01-30 12:31 -0800
    Re: How to avoid a task not executed in a real-time OS? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2019-01-30 16:23 -0500
    Re: How to avoid a task not executed in a real-time OS? "A.P.Richelieu" <aprichelieu@gmail.com> - 2019-01-31 06:05 +0100
    Re: How to avoid a task not executed in a real-time OS? kegs@provalid.com (Kent Dickey) - 2019-02-02 10:44 -0600
      Re: How to avoid a task not executed in a real-time OS? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2019-02-02 12:19 -0500

csiph-web