Re: Async user space notification from kernel?

Brian Perkins (bperkins@netspace.org)
Thu, 26 Aug 1999 14:14:21 -0400


I think your concern is how blocking calls work, which depends entirly
on how the kernel implements this. If you implement the device driver
for your BRB (bigredbutton) so that it outputs a char everytime it's
pushed, then you process can just read from the device file, which
(if implemented properly in the kernel ) will block until the button
is pushed.

Specifically, the process attempts to read, and then is put on a wait
queue until somthing is ready to be read. Once the button is pushed
( how the kernel realizes this is an entirly different matter that has
more to do with hardware than I think you're worried about), the
process can be taken off the wait queue and given the data.

What always has bothered me about UNIX is that there are certain
events that _have_ to b epolled, that really ought not to, such as
file changes, deletions, etc. I discovered this very early on my
hacking carreer when I figured out how "tail -f" worked (sleep,
nonblocking read, repeat).

Might it be useful to add some of these features?
At some point, I thought that with the addition of dcache to the
kernel, this canbe done pretty seamlessly. You just lock the
inode into the dcache, and change the inode so that it points to a
hook that will wake up your process under whatever circumstances you
specify. Adds a little bit of code, but shouldn't impact performance
unless the fetures are used.

--
Persian Brink,Spinnaker Rib, Earn Brisk Nip,Pinker Brains,Bank Inspirer
Brian Perkins                                bperkins@netspace.org

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/