HPlogo Interprocess Communication: Programmer's Guide: HP 3000 MPE/iX Computer Systems > Chapter 4 Special Cases of IPC

Multiple Concurrent Readers or Writers

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

An application may need to use multiple concurrent readers or writers. For example, multiple supervisors may need the services of the same server. The server may not be able to keep up with the requests, and so multiple copies of it may be needed to handle the incoming requests.

Setting up a message file to be accessed by multiple concurrent readers or multiple concurrent writers is not difficult. However, there are some subtleties you should be aware of:

  • Since each reader receives its own record when it does an FREAD, and there is no "broadcast" facility in IPC, there is no way for all readers to receive copies of the same record.

  • If either readers or writers are waiting on an EOF condition, they are awakened in the order in which they called their I/O intrinsics.

  • Although a common command queue works well for both multiple readers and multiple writers, it is advisable to have individual response queues. This ensures that a supervisor receives only the responses to its own commands. In this situation, applications often pass the name of the response message file, or the writer's ID, along with the command, so that the file can be opened and the response sent to the correct destination. (The writer's ID is discussed in the "Writer Identification" section in this chapter.)

Feedback to webmaster