In <[email protected]>, on
11/11/2013
   at 05:15 PM, Jon Perryman <[email protected]> said:

>Take for example:
>     L    R2,QUEUE
>     L    R3,NEXT_ENTRY
>    CS  R2,R3,QUEUE                    New queue head

I'm not sure what you're trying to do. Did you mean this?

LOOP     L     R2,QUEUE
         L     R3,NEXT_ENTRY
         ST    R2,0(,R3)           Forward link
         CS    R2,R3,QUEUE         New queue head
         BNE   LOOP

>While this seems bullet proof, it's not. If there is a long delay
>between between the L instructions then next entry could have been
>freed causing an abend.

It won't cause an ABEND in the code that you showed, and it is just as
serious an error to free it *after* you add it to the queue. Or did
you mean this?

LOOP     L     R2,QUEUE
         USING ENTRY,R2
         L     R3,NEXT_ENTRY
         DROP  R2
         CS    R2,R3,QUEUE         New queue head
         BNE   LOOP

As with adding an entry, freeing the storage inappropriately is an
error when the entry is still on the queue, not just during the CS
loop.

>You need to think about the small details.

Not just the serialization.
 
-- 
     Shmuel (Seymour J.) Metz, SysProg and JOAT
     ISO position; see <http://patriot.net/~shmuel/resume/brief.html> 
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to