HPlogo Interprocess Communication: Programmer's Guide: HP 3000 MPE/iX Computer Systems

Chapter 5 NOWAIT I/O

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Sometimes a programmer wants an application to read or write a record, but does not want it to wait for I/O to complete. For such an application, waiting is wasting time when it could be doing other processing. Timeouts do not adequately address this problem. The programmer wants this application to start an I/O, continue processing immediately, and check periodically to see if the I/O has finished.

MPE/iX provides a way to solve this problem with NOWAIT I/O. This feature is requested by enabling the NOWAIT I/O option (item #16) in HPFOPEN.

When using NOWAIT I/O, the process must make at least two intrinsic calls to perform the I/O, one to start it and one to finish it. MPE/iX still handles the file in the same way. But instead of waiting for the I/O to complete, MPE/iX returns control to the application so that the application can do some useful processing.

NOWAIT I/O has been available to users of standard files for a long time, but to use it on standard files requires Privileged Mode. On standard files the mechanics of NOWAIT I/O prevent MPE/iX from protecting a process from corrupting its own stack. However, because Message files work differently, NOWAIT I/O on Message files does not require Privileged Mode.

Feedback to webmaster