Using STOQ

Storage queues (STOQs) are a medium that processes can use to store information in memory for later retrieval by other processes. Any number of processes can share the same STOQ. A single process could also use a STOQ for temporary storage.

Each message sent to a STOQ simply remains there until a process signals its readiness to receive that message. Further, a single STOQ can store multiple messages. These features make it possible for STOQ applications to run in parallel without having to synchronize the sending or receiving of messages.

The applications that use STOQs can specify whether each message should be sent to, or received from, the top or bottom of a STOQ. This flexibility makes it simple for you to implement last in, first out (LIFO) or first in, first out (FIFO) communications mechanisms.

STOQ applications can also subdivide each STOQ into subqueues with distinct names. Applications can then send messages to, or receive messages from, the top or bottom of each subqueue.

An inquiry mechanism provides a rapid means of determining the number of messages in a STOQ or a subqueue without disturbing any elements.

The programs communicating through STOQs must reside on the same host system.

The following pages present an overview of STOQ communications and describe how to perform STOQ communications through the library interface or through COBOL85 statements.