> > If you want to catch some task/thread in an infinite loop, the hardware > > watchdog monitor in nuttx can do it for you. > > If the hardware watchdog is fed from multiple sources, all of them need to > fail. Not just one of them. > Do you have anything else in mind? > > > You don't need a special timer here, the posix timer can work very well: > > > > 1. Create a watchdog timer by timer_create > > 2. Feed the timer periodically through timer_settime > > 3. Register a timeout signal handler > > 4. Call exit/abort in signal handler > > This is a nice idea, thank you. > I didn't think of it before.
We have a similar watchdog functionality built into a driver. Via an ioctl()-call it is possible to register new individual "watchdogs" that are fed via another ioctl()-call. This way each thread that we want to monitor will register its own watchdog via the ioctl() interface, and the driver will keep track of which thread failed to feed feed it. //Pelle