Re: Help with broken CB chain

2016-10-14 Thread Donald Likens
I found the statement in the POP...

PERFORM LOCKED OPERATION can be thought
of as performing concurrent interlocked updates of
multiple operands. However, the instruction does
not actually perform any interlocked update, and a
serially reusable resource cannot be updated predictably
through the use of both PERFORM
LOCKED OPERATION and conditional-swapping
instructions (CS and CDS).

Thanks for your help.

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


Re: Help with broken CB chain

2016-10-13 Thread Charles Mills
PLO is basically an "island" of its own. CDSx, transactional and CSST all mix 
and match (if I have read the PoOp correctly).

I don't have the time to read the code at the level of detail necessary to find 
this kind of flaw but mixing PLO with CDSG is definitely a recipe for the kind 
of problem you are seeing.

Look into CSST. It solved a problem for me. There is a lot of "locked" power 
there.

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Greg Dyck
Sent: Thursday, October 13, 2016 1:52 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Help with broken CB chain

You *can* *not* safely intermix the use of CDSG and PLO without using special 
protocols.  This is clearly documented in the POPs.

You *can* safely intermix CDSG and transactional execution.

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


Re: Help with broken CB chain

2016-10-13 Thread Greg Dyck
You *can* *not* safely intermix the use of CDSG and PLO without using 
special protocols.  This is clearly documented in the POPs.


You *can* safely intermix CDSG and transactional execution.

Regards,
Greg

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


Re: Help with broken CB chain

2016-10-13 Thread Donald Likens
Missed a line of code at the end... Here is the updated code:

FIRST   DS D
LASTDS D

DOX378   DS0H
 LGR6,LAST   
*C IF FIRST AND LAST EQ 0 
*C SET FIRST AND LAST = NEW CB ADDRESS
 XGR   R4,R4 
 XGR   R5,R5 
 LGR   R2,R8(R8: ADDRESS OF CB)  
 LGR   R3,R8 
 CDSG  R4,R2,FIRST IF FIRST & LAST 0, STM 2,3,FIRST
 BC4,ELIFX076
*C   ELSE
 BC8,EDOX378 
ELIFX076 DS0H
*C IF LAST = LAST (R6) 
*C   SET LAST = POINTER_TO_NEW_ (R8)   
*C   SET NEXT.OF.LAST.ONCHAIN= POINTER_TO_NEW_ (R8)
 STG   R6,OPERAND1(COMPARISON VALUE)   
 STG   R8,OPERAND1R   (REPLACEMENT VALUE)  
 LAR0,CSDSTG   
 LGR   R3,R8   
 LAR4,LAST   LAST IS IN CSA
 STG   R4,OPERAND6 
 DROP  R8  
 USING CB,R6   
 LAR4,NEXT   NEXT IS IN CSA
 STG   R4,OPERAND4 
 STG   R8,OPERAND3 
 STG   R8,OPERAND5 
 PLO   0,LAST,0,PL 
*  THE FIRST-OPERAND COMPARISON VALUE AND THE SECOND OPERAND ARE   
*  COMPARED.  IF THEY ARE EQUAL, THE FIRST-OPERAND REPLACEMENT VALUE   
*  IS STORED AT THE SECOND-OPERAND LOCATION, AND THE THIRD OPERAND IS  
*  STORED AT THE FOURTH-OPERAND LOCATION. THEN, THE FIFTH OPERAND IS   
*  STORED AT THE SIXTH-OPERAND LOCATION.
 BNZ   DOX378
EDOX378  DS0H   

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


Help with broken CB chain

2016-10-13 Thread Donald Likens
I have a control block chain in CSA above the BAR that is updated from multiple 
address spaces with a first and last pointer. The last entry in the chain has a 
next = 0. If there are no entries in the chain the first and last pointer = 0. 
I seem to be adding two entries to the beginning of the chain at the same time 
because rarely one of the control blocks is never freed and it always has a 
next pointer of zero.   

I use the following code to add a control block to the end of the chain (always 
add to the end of the chain):

FIRST   DS D
LASTDS D

DOX378   DS0H
 LGR6,LAST   
*C IF FIRST AND LAST EQ 0 
*C SET FIRST AND LAST = NEW CB ADDRESS
 XGR   R4,R4 
 XGR   R5,R5 
 LGR   R2,R8(R8: ADDRESS OF CB)  
 LGR   R3,R8 
 CDSG  R4,R2,FIRST IF FIRST & LAST 0, STM 2,3,FIRST
 BC4,ELIFX076
*C   ELSE
 BC8,EDOX378 
ELIFX076 DS0H
*C IF LAST = LAST (R6) 
*C   SET LAST = POINTER_TO_NEW_ (R8)   
*C   SET NEXT.OF.LAST.ONCHAIN= POINTER_TO_NEW_ (R8)
 STG   R6,OPERAND1(COMPARISON VALUE)   
 STG   R8,OPERAND1R   (REPLACEMENT VALUE)  
 LAR0,CSDSTG   
 LGR   R3,R8   
 LAR4,LAST   LAST IS IN CSA
 STG   R4,OPERAND6 
 DROP  R8  
 USING CB,R6   
 LAR4,NEXT   NEXT IS IN CSA
 STG   R4,OPERAND4 
 STG   R8,OPERAND3 
 STG   R8,OPERAND5 
 PLO   0,LAST,0,PL 
*  THE FIRST-OPERAND COMPARISON VALUE AND THE SECOND OPERAND ARE   
*  COMPARED.  IF THEY ARE EQUAL, THE FIRST-OPERAND REPLACEMENT VALUE   
*  IS STORED AT THE SECOND-OPERAND LOCATION, AND THE THIRD OPERAND IS  
*  STORED AT THE FOURTH-OPERAND LOCATION. THEN, THE FIFTH OPERAND IS   
*  STORED AT THE SIXTH-OPERAND LOCATION.
EDOX378  DS   0h

Note: I think I could use a CSSTG PLO but this should work and I don’t want to 
break what normally works since this is production code.  I have looked at this 
code until my eyes are falling out. Does anyone see a flaw in this logic?   

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