>I don't know all about mmap, but why does one need to poll.
>I would have thought that a callback with info on how many samples it wants
>would be a better way.

there is no generalized mechanism for the kernel to call userspace code.

POSIX signals are the canonical examples of such a thing, where
userspace attaches a handler, and the kernel ensures that if the
signal is delivered, the thread returns to user space to execute that
code. however, this is a highly specific mechanism with lots of
semantics that get in the way of this being a broadly useful system.

some unix-like systems have played with allowing kernel->userspace
callbacks; none of the APIs has ever taken off. i even implemented one
once for Mach - it wasn't easy :)

poll(2) is a nice method for this in the absence of such a mechanism.
both it and select(2) are moderately broad mechanisms that allow
userspace to execute code when certain conditions happen.

--p


_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to