[En-Nut-Discussion] Thread priority
Ralph Mason
ralph.mason at telogis.com
Fri May 18 04:19:54 CEST 2007
Rather then re-typing on a subject covered before :-)
http://osdir.com/ml/hardware.microcontrollers.ethernut/2005-09/msg00068.html
Ralph
-----Original Message-----
From: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] On Behalf Of Henrik Maier
Sent: Friday, 18 May 2007 11:02 a.m.
To: Ethernut User Chat (English)
Subject: Re: [En-Nut-Discussion] Thread priority
Petting a watchdog in an timer ISR defeats the purpose (assuming your
purpose is to detect software defects not only hardware defects). It is
very likely that your timer ISR is still executed even your main
application has fully crashed.
Some thought has to be spend on implementing a sensible watchdog
supervision in a multi-threaded application and there is no general
answer as it depends how your worker threads are executed. That can be
event driven, cyclically or something else.
In a concept I have implemented in several designs I supervise all
threads from a low priority master thread. If that master thread sees
one worker thread not meeting it's performing criteria, then we stop
petting the watchdog. The performance criteria depends on what the
thread is doing and is in most cases simply monitoring a cycle counter.
Is also have event-blocking threads (TCP read/accept etc) time-out so
they can report to the monitoring thread that they are still alive.
At the end of the day each thread is a self contained execution
environment which needs to be monitored. Each single thread can lock-up
in a way that the other thread still executes and this should be taken
into account in a watchdog concept.
Henrik
http://www.proconx.com
Alexander Baranov wrote:
> Really I don't rely upon threads and use timer interrupt for that.
> Alexnder.
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion
--
Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.9/573 - Release Date: 5/12/2006
4:07 p.m.
--
Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.9/573 - Release Date: 5/12/2006
4:07 p.m.
More information about the En-Nut-Discussion
mailing list