If I understand your situation, then you are maintaining a queue. Today, you 
are probably queuing in the reverse order using CS (LIFO). You want to 
eliminate reversing the queue (FIFO) by using PLO to create the queue FIFO.

PLO is desgned to solve this problem. PLO doesn't care about the store fields 
and values. It only serializes the counter that has been described. In your 
case, the serialization is to represent any change to the queue regardless of 
the location on the queue.  

Fields: counter, address of first queued CB and address of last queued CB.

To remove queued entries:
1. Load and increment counter. Must be first to ensure correct to ensure step 2 
is the correct CB address..
2. Save first queued CB address.
3. PLO CSDST counter and store 0 at first & last CB address
4. Repeat if PLO failed.

To add to the queue
1. Load and increment counter
2. Copy last CB address to the backwards pointer of the new CB.
3. PLO CSDST counter and store new CB address in the forward pointer of the 
last CB  and store the new CB address in the last CB address.
4. Repeat if PLO fails.

You could serialize updates to any entry in the queue, just the same as the add 
but the second step would be to locate the entry to be updated. If you  If you 
are deleting entries, you might need to use PLO compare and load  when scanning 
thru the chain.

Is it more efficient to continue using CS / reverse chain or to use PLO to 
build the chain in the correct sequence?

Jon Perryman.


>________________________________
> From: Tony Harminc <t...@harminc.net>
>
>
>> Now that I understand it (mostly) I am pretty sure it will not work for me. 
>> My problem is that a process comes in and removes the control block chain 
>> while another process is suspended and attempting to update the chain. When 
>> the updating process wakes up S0C4! That is why I was looking at using 
>> locks. If the process updating the chain holds a lock and the process 
>> removing the chain needs that lock to update the pointers this would not 
>> happen.
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to