1 Dec 2003 09:18
Re: mpc / linux kernel - user space
Jaap-Jan Boor <jjboor <at> aimsys.nl>
2003-12-01 08:18:55 GMT
2003-12-01 08:18:55 GMT
On Fri, 2003-11-28 at 16:42, Dan Malek wrote: > Jaap-Jan Boor wrote: > > > If you want to send a signal to user code, you can use kill_proc() > > I think. > > IMHO, trying to use signals to propagate a hardware interrupt to a > user application is complicated and has design flaws (what happens > if the application "misses" an interrupt or gets blocked for some > reason). Fortunately I never used it (that's the 'I think') > > A couple of other methods that I find simple and use extensively > are multi-threading the application and then using a different > minor ID device to wait on a read() or ioctl() to simply return. > The driver just uses the standard sleep/wakeup mechanisms to > synchronize with the application. > > Another, and I think most useful, method is to implement a select/poll > entry point in the driver. It provides the most flexibility when > waiting for various events, plus provides a timeout should something > fail to function properly. Yes, especially the timeout is nice as 'this should never happen' failures never happens except with the customer Jaap-Jan(Continue reading)
RSS Feed