> One use for a circular queue is a wrapping trace table.  Normally it's a

>queue that's never harvested until there's an abend,


The system trace table (not a queue) is circular but it has an atomic 
instruction specific to moving the trace entry.

For a trace table, PLO will work up to PLO size limit. There is a simple 
solution once you exceed that limit. The trace table becomes a table of 
pointers to trace entries and you use a chained free queue. The logic:

1. CS get next free queue entry. If empty, storage obtain a new one.
2. Fill in trace data
3. PLO update trace index and trace pointer. Keep the old trace pointer for 
next step. 
4. CS Place old trace pointer onto the free queue chain.

Chains are your friend when multi-tasking. There are thousands of examples 
where we use them to eliminate multitasking problems (e.g. TCB, RB, SSCT, CICS, 
JES ...). The technique has proven to be simple and reliable.

Jon.  

Reply via email to