|
|
Microsoft OS/2 SDK 12-15-1987
Queue Example Description:
--------------------------
A cafeteria has a headwaiter. He creates a queue into which requests are
placed by the cafeteria's gatekeeper.
The cafeteria has a number for each table meant for seating cutomers.
The gatekeeper receives customers in groups, assigns each group a table.
Corresponding to each table assignment, he places a request (indicating the
table at which the customer group is seated) on a queue.
When he decides that it is time for closing the cafeteria, he places
the last request on the queue indicating that there will be no more
customers.
The headwaiter reads each request from the queue (for FIFO : according to
first come, first serve. For LIFO, last in gets first table, and for PRIOrity,
according to each customers priority) and dispatches a waiter to the table
where the customer group is seated. The headwaiter closes the queue as soon
as he reads a request that has the RequestID set to NOMORE (i.e, there will
be no more customers).
The file serv.c emulates the headwaiter. The file cust.c emulates
the gatekeeper.
Running this example:
The customer and server processes need to be running at the same
time. Hence, do the following:
o At prompt, type
fifoque <CR> for FIFO queues example
or lifoque <CR> for LIFO queues example
or prioque <CR> for PRIOrity queues example
------------------------------------------------------------------------------
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.