[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]

The more characters that are processed in each I/O request, the higher the
total throughput of the device.  The following technique will minimize
device overhead for reads:

   *  Use the sdcmd_query command to get the number of characters currently
      in the buffer (see the devices/serial.h autodocs for information on
      SDCMD_QUERY).

   *  Use doio() to read all available characters (or the maximum size of
      your buffer).  In this case, doio() is guaranteed to return without
      waiting.

   *  If zero characters are in the buffer, post an asynchronous request
      (sendio()) for 1 character.  when at least one is ready, the device
      will return it.  Now go back to the first step.

   *  If the user decides to quit the program, abortio() any pending
      requests.