Next: , Up: The File Library   [Index]


13.8.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 The Open Functions.

See 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 The 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’, ‘f_peek’ and ‘f_yank’ are good candidates for one byte at the time readers, and so is ‘f_peep’ provided that all the needed bytes are already cached. All the functions 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 File Input Functions.

f_b_read’ should also work fine with non blocking files.

See Byte Data File Input Functions.

See Miscellaneous File Functions.

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


Next: The Open Functions, Up: The File Library   [Index]