Skip to main content

Ability to Learn How Many Messages Are Waiting

A process should be able to determine how many messages are left to be processed on a given input channel. Two uses are readily thought of. Given pending inputs on several channels a process should be able to exercise preference. One decision might be to take input first from the channel with the most messages queued. This might have the effect of increasing throughput since by freeing message buffers the remote transmitting process might be allowed to run. Another possibility might be that the receiving process has some control over the sending process and, upon observing the backlog on inputs, it could tell that process to slow down.

Assuming that the remote process is still able to send messages, the number of inputs reported is only a lower bound. New inputs may be added concurrently. If the foreign process has died or has otherwise closed the connection then the bound can be made exact. The local process should be able to learn when it is exact.