How to force a thread to stop

H J van Rooyen mail at microcorp.co.za
Fri Jul 28 08:49:39 EDT 2006


"Paul Rubin" <http://phr.cx@NOSPAM.invalid> Wrote:


| "H J van Rooyen" <mail at microcorp.co.za> writes:
| > So on a processor that does not have protected instructions - if an
| > idiot writes something to the following effect :
| >
| > *instructions to disable interrupts*
| >
| > followed by :
| >
| > *instructions that go into an infinite loop AND that make no OS calls*
| >
| > the whole bang shoot stops dead - Reset your machine...
|
| A common recovery mechanism in embedded systems is a watchdog timer,
| which is a hardware device that must be poked by the software every
| so often (e.g. by writing to some register).  If too long an interval
| goes by without a poke, the WDT hard-resets the cpu.  Normally the
| software would poke the WDT from its normal periodic timing routine.
| A loop like you describe would stop the timing routine from running,
| eventually resulting in a reset.

*grin* - Yes of course - if the WDT was enabled - its something that I have not
seen on PC's yet...

- Hendrik






More information about the Python-list mailing list