nextupprevious

Event Mechanisms

  1. select() where a process passes an "interest set" to the kernel and the kernel returns the set of fds ready for service.

    Issues:
    sparse sets leading to kernel scan time
    issue if kernel does not support per-thread select()---thundering herd

  2. poll() where have a list of interest and ready fd structures. Better if the list is sparse, worse if the list is dense.

  3. Real Time (RT) signals. Associate a RT signal with a file descriptor as shown in Figure 1. A signal is sent to process each time a new event (new connection, read/write availability) occurs for fd.

    Can use sigwaitinfo() to make signal reception be synchronous. Can obtain fd from siginfo structure (Figure 2).

    An issue is that signal queue is finite. Can have overflow problem.

  4. NT provides I/O completion ports. Event queue and fixed number of pre-forked threads.