The ionotify() function is a means by which a client thread can request asynchronous event delivery.
Many of the POSIX asynchronous services (e.g. the client-side of the select() ) are built on top of ionotify() . When performing I/O on a file descriptor (fd), the thread may choose to wait for an I/O event to complete (for the write() case), or for data to arrive (for the read() case). Rather than have the thread block on the resource manager process that's servicing the read/write request, ionotify() can allow the client thread to post an event to the resource manager that the client thread would like to receive when the indicated I/O condition occurs. Waiting in this manner allows the thread to continue executing and responding to event sources other than just the single I/O request.
The select() call is implemented using I/O notification and allows a thread to block and wait for a mix of I/O events on multiple fd's while continuing to respond to other forms of IPC.
Here are the conditions upon which the requested event can be delivered:
- _NOTIFY_COND_OUTPUT—there's room in the output buffer for more data.
- _NOTIFY_COND_INPUT—resource-manager-defined amount of data is available to read.
- _NOTIFY_COND_OBAND—resource-manager-defined out of band data is available.