Up: File Library Specifics   [Index]


7.11.1.1 Nonblocking I/O

Files may be opened in non blocking mode, with the subsequent I/O operations transferring data when and in the amount for which the other end is ready.

See (aime)The Open Functions.

See (aime)The File Open Definitions.

Output files opened in non blocking mode operate in a the pull model, in which they store all given data and any actual output transfer is commanded explicitly.

The command means include the control library ‘dispatch’ objects that provide for output channel polling and non blocking output file draining.

See Control Library.

Non blocking input does not work like the blocking one and the exported input interfaces may and will err on files opened in non blocking mode, possibly losing data in the process.

One of the ways of doing non blocking input is to command reading of no more than one byte at the time and only when input is available. The control library ‘dispatch’ objects will come again handy in deciding when the latter condition is met.

The byte reading interfaces ‘f_pick’ and ‘f_peek’ are good candidates for one byte at the time readers, and so is ‘f_peep’ provided that all the bytes prior to the requested one are already cached. They all read as much as possible and when they read more than the one requested byte the extra read bytes may be queried and flushed via such interfaces as ‘f_stored’, ‘f_peep’, ‘f_skip’, etc.

See (aime)The File Input Functions.

See (aime)Miscellaneous File Functions.

Files opened in non blocking mode are assumed operating on character devices and seeking may not be supported at all.


Up: File Library Specifics   [Index]