Browse Prior Art Database

High Performance Poll/ Selection Function for UNIX Operating Systems

IP.com Disclosure Number: IPCOM000108119D
Original Publication Date: 1992-Apr-01
Included in the Prior Art Database: 2005-Mar-22
Document File: 3 page(s) / 181K

Publishing Venue

IBM

Related People

Coley, ML: AUTHOR [+2]

Abstract

The traditional UNIX* support of select for notification of the occurrence of multiple events has too much path-length to be used with today's high-speed communications devices. A lighter weight implementation was required to reduce the re-polling of the device drivers to determine which one(s) had an outstanding event.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 36% of the total text.

High Performance Poll/ Selection Function for UNIX Operating Systems

       The traditional UNIX* support of select for notification
of the occurrence of multiple events has too much path-length to be
used with today's high-speed communications devices. A lighter weight
implementation  was required to reduce the re-polling of the device
drivers to determine which one(s) had an outstanding event.

      On traditional BSD UNIX operating systems a select system call
was provided to allow processes that are serving multiple devices, to
wait on one or more events from one or more of these devices. This
implementation, however, was very inefficient in that it called all
of the selected devices to see if they had any events, and if none
did, it put the calling process to sleep to wait on an event. When
device driver's select routines were called they had to remember the
event requested, and the process id of the requester. When the device
driver detected more than one process requesting event notification,
it set an overflow flag. Then, when an event occurred, it would call
the selwakeup routine with the process id requesting event
notification or indicate overflow (more than one process requested
event notification). If the overflow flag was not set, the kernel
would wake up the indicated process which would then call every
selected device driver again to see which one had the outstanding
event. If the overflow flag was set, all processes sleeping on any
event for any device would be awakened and each one would call each
device driver to see if any events had occurred. This mechanism is
very inefficient and insufficient for high performance processes that
service multiple devices (such as network servers).

      The BSD 4.3 select and the System V.3 Poll system call
functions were combined into a common mechanism to support
synchronous I/O event notification. In order to provide a high
performance event notification mechanism, an event control block was
built by the kernel for each event or set of events requested for a
particular device or event object (such as a socket, message queue,
pipe). This control block contains the device identifier, requested
events word, returned events word and process identifier of the
requesting process. The device's select routine was then called, and
if a requested event was true, the control block was freed and the
event flagged in the output event list to the caller. In addition a
synchronous flag was then set, which would prevent event control
blocks from being allocated when other objects in the event list were
being polled. This also allowed the object's select routine to
refrain from saving any information about the request since only the
current event status was required. This time-saving feature
capitalizes on the fact that the caller is to be notified if one or
more events is true, and will only wait on events if none of the
requested events are true. If no events were outstanding, the eve...