On Tue, Sep 18, 2001 at 07:12:19AM -0700, Usman S. Ansari wrote: > My kernel module is talking to user application over a socket. I want to > timeout, if for any reason user application is not running. Using sys_select > seemed like a good idea (until this, see below). The other idea I had was to > use timer and send a sigterm to the thread which is sitting on a sock_recvmsg > call. This works, but there is a race condition, get data over recvmsg, before > I remove timer, timer pops up. > > What would be a good way, any suggestions ? The first question is why your kernel module wants to talk over a socket _at all_. This smells like policy in the kernel, while the kernel should only provide mechanisms. Most of the time moving the policy to userland makes the total design much cleaner. Erik -- J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department of Electrical Engineering, Faculty of Information Technology and Systems, Delft University of Technology, PO BOX 5031, 2600 GA Delft, The Netherlands Phone: +31-15-2783635 Fax: +31-15-2781843 Email: J.A.K.Mouw@its.tudelft.nl WWW: http://www-ict.its.tudelft.nl/~erik/ - Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ IRC Channel: irc.openprojects.net / #kernelnewbies Web Page: http://www.kernelnewbies.org/