lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Is Pi with X-window good enough control /wo watchdog timer

Wed Apr 23, 2014 3:30 pm

I want to use the Pi as the control system but I don't want the system to hang. Some people use a watchdog timer to watch the Pi, if it doesn't respond, the watchdog would power reset the Pi.

If I use the Pi in X-window(GUI) which is multiple tasking, is the chance of the system being hang is pretty low? Yeah, one particular task maybe got hung but not the whole system in X-window environment right?

So, I guess I don't need a watchdog for that?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26660
Joined: Sat Jul 30, 2011 7:41 pm

Re: Is Pi with X-window good enough control /wo watchdog tim

Wed Apr 23, 2014 3:45 pm

It depends what hangs. If the Linux kernel hangs, then you need a watchdog. But I beleive that would be quite unlikely. In fact, hangs in general are unlikely given decently written software.

Note that X is multitasking because Linux itself is. X doesn't add multitasking, it just uses what is already there
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Is Pi with X-window good enough control /wo watchdog tim

Wed Apr 23, 2014 3:53 pm

The only time I've ever crashed my Pi was using batteries, a wifi dongle and a 3 watt speaker amp running off the USB port instead of the battery pack USB port.
If you're using a main power supply then the Pi shouldn't hang, if it does then something is probably wrong with the PSU or your F3 polyfuse is going bad http://elinux.org/R-Pi_Troubleshooting# ... r_problems

Richard S.

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Is Pi with X-window good enough control /wo watchdog tim

Wed Apr 23, 2014 3:58 pm

On a uni-processor with a looping task (no external calls) you've very little chance even with a watchdog if you get an un-interupptable process running. Those things need a hardware process to get control back (like the Linux magic keys).

With normal userspace programming the stuff that runs there spends lots of time waiting for i/o events (and even longer if there's a human involved). The detection of long running tasks is a lot easier, depending on whether the dispatcher is pre-emptive or reactive. With Raspbian it's built with the pre-emptive options set for both kernel (hey, that's new since I last built a kernel) and userspace so it's a very robust system.

The likelihood of triggering any watchdog for a userspace program is so small it's probably not worth the effort of setting one up.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “General discussion”