How to force a thread to stop
Paul Rubin
http
Fri Jul 28 03:48:21 EDT 2006
"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.
More information about the Python-list
mailing list