Re: Transactional Execution - anybody used it?

2017-03-06 Thread Binyamin Dissen
Based on the relatively code path supported, it appears to be that the best
use of it to replace/simplify the more complicated PLO cases where there is a
lot of setup and the need for working storage. Don't know which will get
better performance.

On Mon, 6 Mar 2017 00:03:15 -0500 Peter Relson  wrote:

:>As you might assume, the operating system uses transactional execution.

:>A caveat: you cannot use it unconditionally. Even if you know you are on 
:>the right machine. One reason for that is that it cannot be used if z/OS 
:>is running on/under VM. Another is that we have given the customer a knob 
:>to ask that transactional execution not be used when they are migrating to 

:>a new machine and really want, first, to make sure that the machine works 
:>before worrying about whether new code paths in the software also work. 
:>This is the MACHMIG statement of the LOADxx parmlib member. You must pay 
:>attention to the PSA/CVT bit (you can choose which you want to look at) 
:>which is on when available.

:>Transactional execution is used, for example, within supervisor, IOS, RSM. 

:>It is what makes "contractible CPOOL" possible and available.

:>We tend to look for cases where we can use TBEGINC rather than TBEGIN. 
:>That is because any use of TBEGIN requires accepting the possibility of 
:>too many aborts, and providing "traditional serialization" in the fallback 

:>path. And this means that the user of a transaction must also serialize 
:>against the user of "traditional serialization". "Traditional 
:>serialization" could be the local lock, an ENQ, a latch, etc.

:>One of the use cases is to avoid coarse-grained serialization when 
:>fine-grained serialization will do. The LOCAL lock is a case of 
:>coarse-grained serialization. It serializes lots of stuff. But sometimes 
:>you might be using it to serialize only "your stuff". Yet you are still 
:>contending for the resource with other users of the LOCAL lock, so could 
:>be adversely impacted by those cases (and your usage could adversely 
:>impact others). If you can use TBEGIN(C),  you no longer need to contend 
:>with other users of the LOCAL lock.

:>This is a performance-related facility. Performance needs should dictate 
:>how much you choose to use it.

--
Binyamin Dissen 
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel


Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.

I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.


Re: Transactional Execution - anybody used it?

2017-03-05 Thread Peter Relson


As you might assume, the operating system uses transactional execution.

A caveat: you cannot use it unconditionally. Even if you know you are on 
the right machine. One reason for that is that it cannot be used if z/OS 
is running on/under VM. Another is that we have given the customer a knob 
to ask that transactional execution not be used when they are migrating to 

a new machine and really want, first, to make sure that the machine works 
before worrying about whether new code paths in the software also work. 
This is the MACHMIG statement of the LOADxx parmlib member. You must pay 
attention to the PSA/CVT bit (you can choose which you want to look at) 
which is on when available.

Transactional execution is used, for example, within supervisor, IOS, RSM. 

It is what makes "contractible CPOOL" possible and available.

We tend to look for cases where we can use TBEGINC rather than TBEGIN. 
That is because any use of TBEGIN requires accepting the possibility of 
too many aborts, and providing "traditional serialization" in the fallback 

path. And this means that the user of a transaction must also serialize 
against the user of "traditional serialization". "Traditional 
serialization" could be the local lock, an ENQ, a latch, etc.

One of the use cases is to avoid coarse-grained serialization when 
fine-grained serialization will do. The LOCAL lock is a case of 
coarse-grained serialization. It serializes lots of stuff. But sometimes 
you might be using it to serialize only "your stuff". Yet you are still 
contending for the resource with other users of the LOCAL lock, so could 
be adversely impacted by those cases (and your usage could adversely 
impact others). If you can use TBEGIN(C),  you no longer need to contend 
with other users of the LOCAL lock.

This is a performance-related facility. Performance needs should dictate 
how much you choose to use it.

Peter Relson
z/OS Core Technology Design


Re: Transactional Execution - anybody used it?

2017-03-03 Thread Sam Siegel
I believe that one of the primary uses of the transactional execution
facility is to solve the ABA problem in a lightweight and efficient
manner.

https://en.wikipedia.org/wiki/ABA_problem

On Fri, Mar 3, 2017 at 9:10 AM, Ngan, Robert <rn...@csc.com> wrote:
> I looked into it, but we don't have the appropriate h/w so I can't play with 
> it yet.
> The unconstrained version may always fail, so you need to always create a 
> non-transactional version of the code just in case (so this doubles your 
> coding effort).
> The only immediate use I could think of for this facility would be in STAE 
> code to check dereferencing of potentially corrupted pointers without the 
> overhead setting up another SPIE/STAE.
>
> Robert
>
> -Original Message-
> From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] 
> On Behalf Of Charles Mills
> Sent: Friday, March 03, 2017 09:00
> To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
> Subject: Re: Transactional Execution - anybody used it?
>
> I *considered* it for a problem of updating a queue in a multiprocessor 
> reentrance situation. I ended up solving the problem with CSST which seemed 
> like a simpler approach.
>
> Charles
>
>
> -Original Message-
> From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] 
> On Behalf Of John McKown
> Sent: Friday, March 3, 2017 6:32 AM
> To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
> Subject: Re: Transactional Execution - anybody used it?
>
> OK, I guess I asked my question poorly. And I should not have said anything 
> about the PLO (instruction, not Mid-East organization)
>
> So. Has anyone on this forum actually used the TBEGIN and TEND instructions 
> in their code? I would appreciate knowing what / why they chose to do so.
> I'm just trying to understand the real purpose of these instructions on a 
> PRACTICAL level. Yes, I've read up on "Transactional Memory" on the web.
> And how it allows "atomic updates". But I would like a real world example of 
> why use this vs. the older "atomic" instructions (TSET, CS, CDS, PLO, etc).
>
>  CSC - This is a PRIVATE message - If you are not the intended recipient, 
> please delete without copying and kindly advise us by e-mail of the mistake 
> in delivery.  NOTE: Regardless of content, this e-mail shall not operate to 
> bind the Company to any order or other contract unless pursuant to explicit 
> written agreement or government initiative expressly permitting the use of 
> e-mail for such purpose.


Re: Transactional Execution - anybody used it?

2017-03-03 Thread Ngan, Robert
I looked into it, but we don't have the appropriate h/w so I can't play with it 
yet.
The unconstrained version may always fail, so you need to always create a 
non-transactional version of the code just in case (so this doubles your coding 
effort).
The only immediate use I could think of for this facility would be in STAE code 
to check dereferencing of potentially corrupted pointers without the overhead 
setting up another SPIE/STAE.

Robert

-Original Message-
From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On 
Behalf Of Charles Mills
Sent: Friday, March 03, 2017 09:00
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Transactional Execution - anybody used it?

I *considered* it for a problem of updating a queue in a multiprocessor 
reentrance situation. I ended up solving the problem with CSST which seemed 
like a simpler approach.

Charles


-Original Message-
From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On 
Behalf Of John McKown
Sent: Friday, March 3, 2017 6:32 AM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Transactional Execution - anybody used it?

OK, I guess I asked my question poorly. And I should not have said anything 
about the PLO (instruction, not Mid-East organization)

So. Has anyone on this forum actually used the TBEGIN and TEND instructions in 
their code? I would appreciate knowing what / why they chose to do so.
I'm just trying to understand the real purpose of these instructions on a 
PRACTICAL level. Yes, I've read up on "Transactional Memory" on the web.
And how it allows "atomic updates". But I would like a real world example of 
why use this vs. the older "atomic" instructions (TSET, CS, CDS, PLO, etc).

 CSC - This is a PRIVATE message - If you are not the intended recipient, 
please delete without copying and kindly advise us by e-mail of the mistake in 
delivery.  NOTE: Regardless of content, this e-mail shall not operate to bind 
the Company to any order or other contract unless pursuant to explicit written 
agreement or government initiative expressly permitting the use of e-mail for 
such purpose.


Re: Transactional Execution - anybody used it?

2017-03-03 Thread Tom Marchant
On Fri, 3 Mar 2017 11:02:03 -0500, Tom Marchant wrote:

>http://www.share.org/p/do/sd/topic=50=9872

Here are a couple more:
https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.ieaa600/transx.htm
http://www.redbooks.ibm.com/iea/pdf/zOS_V2R1_BCP_Supervisor_Transactional_Execution.pdf

-- 
Tom Marchant


Re: Transactional Execution - anybody used it?

2017-03-03 Thread Mark Boonie
> So. Has anyone on this forum actually used the TBEGIN and TEND 
instructions
> in their code? I would appreciate knowing what / why they chose to do 
so.
> I'm just trying to understand the real purpose of these instructions on 
a
> PRACTICAL level. Yes, I've read up on "Transactional Memory" on the web.
> And how it allows "atomic updates". But I would like a real world 
example
> of why use this vs. the older "atomic" instructions (TSET, CS, CDS, PLO,
> etc).

The existing locking instructions are pretty straightforward when coding 
them directly, but things can get messy when using them in generic service 
routines or in macros.  For example:

- You're updating existing code and find that you need to call a 
macro/routine that obtains a lock that you already hold.  Now you need to 
either update the interface to indicate you already hold it (and update 
all existing callers of that interface) or duplicate the routine to create 
a "lock already held" version.

- You're updating a service routine and now you need to obtain a lock. But 
some existing callers already hold the lock and others don't.  Do you 
treat "already held" as an expected condition and possibly overlook a 
programming error?  Or do you update the interface to include an "I 
already hold the lock" flag and then update all existing callers to use 
the new interface?

- You may find that you need to hold lock B, after you've already held 
lock A.  But another routine gets lock B first and then gets lock A.  If 
you know about the other routine then you might be able to rework your 
logic to get the locks in the same order.  If you don't know about the 
other routine and they end up running at the same time, you could end up 
in a deadly embrace.

- You need to perform an atomic update in a routine that's enabled for 
interruptions.  Disabling/enabling can be expensive, but if you get 
interrupted in the middle of your update, other routines might see your 
updates as not-so-atomic.

This doesn't mean that transactions should always be used in place of 
locks.  But transactions can sometimes be very useful in writing cleaner, 
more straightforward code by not having to worry about recursive holds or 
hold sequences.

- mb


Re: Transactional Execution - anybody used it?

2017-03-03 Thread Tom Marchant
I haven't used it yet. When I first heard about it, I had some ideas of 
how I might use it, but can't remember any of them now.

Have you seen this SHARE presentation?
http://www.share.org/p/do/sd/topic=50=9872

-- 
Tom Marchant


Re: Transactional Execution - anybody used it?

2017-03-03 Thread Charles Mills
I *considered* it for a problem of updating a queue in a multiprocessor 
reentrance situation. I ended up solving the problem with CSST which seemed 
like a simpler approach.

Charles


-Original Message-
From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On 
Behalf Of John McKown
Sent: Friday, March 3, 2017 6:32 AM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Transactional Execution - anybody used it?

OK, I guess I asked my question poorly. And I should not have said anything 
about the PLO (instruction, not Mid-East organization)

So. Has anyone on this forum actually used the TBEGIN and TEND instructions in 
their code? I would appreciate knowing what / why they chose to do so.
I'm just trying to understand the real purpose of these instructions on a 
PRACTICAL level. Yes, I've read up on "Transactional Memory" on the web.
And how it allows "atomic updates". But I would like a real world example of 
why use this vs. the older "atomic" instructions (TSET, CS, CDS, PLO, etc).


Re: Transactional Execution - anybody used it?

2017-03-03 Thread John McKown
OK, I guess I asked my question poorly. And I should not have said anything
about the PLO (instruction, not Mid-East organization)

So. Has anyone on this forum actually used the TBEGIN and TEND instructions
in their code? I would appreciate knowing what / why they chose to do so.
I'm just trying to understand the real purpose of these instructions on a
PRACTICAL level. Yes, I've read up on "Transactional Memory" on the web.
And how it allows "atomic updates". But I would like a real world example
of why use this vs. the older "atomic" instructions (TSET, CS, CDS, PLO,
etc).

On Fri, Mar 3, 2017 at 8:18 AM, Blaicher, Christopher Y. <
cblaic...@syncsort.com> wrote:

> PLO is not Transactional-Execution Facility related.  Look it up in
> chapter 5 of the POP. I have not used it, yet.
>
> Chris Blaicher
> Technical Architect
> Mainframe Development
> Syncsort Incorporated
> 2 Blue Hill Plaza #1563, Pearl River, NY 10965
>
> P: 201-930-8234  |  M: 512-627-3803
> E: cblaic...@syncsort.com
>
> www.syncsort.com
>
> CONNECTING BIG IRON TO BIG DATA
>
>
> -Original Message-
> From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU]
> On Behalf Of Ngan, Robert
> Sent: Thursday, March 2, 2017 7:22 PM
> To: MVS List Server 2 <ASSEMBLER-LIST@LISTSERV.UGA.EDU>
> Subject: Re: Transactional Execution - anybody used it?
>
> The " Compare and swap and double store" function of PLO?
>
> -Original Message-
> From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU]
> On Behalf Of John McKown
> Sent: Thursday, March 02, 2017 15:32
> To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
> Subject: Transactional Execution - anybody used it?
>
> I'm just curious. I don't, personally, have any need for it at present. I
> can envision some need for it, such as "atomically" incrementing one
> variable by some amount and decrementing another by that same amount (like
> DB2 does within an SQL transaction). Or maybe updating a double linked
> list to remove a node.
>
> I tried to see if there were any Redbooks about it, but my searches didn't
> find anything.
>
> --
> "Irrigation of the land with seawater desalinated by fusion power is
> ancient. It's called 'rain'." -- Michael McClary, in alt.fusion
>
> Maranatha! <><
> John McKown
>
>  CSC - This is a PRIVATE message - If you are not the intended recipient,
> please delete without copying and kindly advise us by e-mail of the mistake
> in delivery.  NOTE: Regardless of content, this e-mail shall not operate to
> bind the Company to any order or other contract unless pursuant to explicit
> written agreement or government initiative expressly permitting the use of
> e-mail for such purpose.
>



-- 
"Irrigation of the land with seawater desalinated by fusion power is
ancient. It's called 'rain'." -- Michael McClary, in alt.fusion

Maranatha! <><
John McKown


Re: Transactional Execution - anybody used it?

2017-03-03 Thread Blaicher, Christopher Y.
PLO is not Transactional-Execution Facility related.  Look it up in chapter 5 
of the POP. I have not used it, yet.

Chris Blaicher
Technical Architect
Mainframe Development
Syncsort Incorporated 
2 Blue Hill Plaza #1563, Pearl River, NY 10965

P: 201-930-8234  |  M: 512-627-3803    
E: cblaic...@syncsort.com

www.syncsort.com

CONNECTING BIG IRON TO BIG DATA


-Original Message-
From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On 
Behalf Of Ngan, Robert
Sent: Thursday, March 2, 2017 7:22 PM
To: MVS List Server 2 <ASSEMBLER-LIST@LISTSERV.UGA.EDU>
Subject: Re: Transactional Execution - anybody used it?

The " Compare and swap and double store" function of PLO?

-Original Message-
From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On 
Behalf Of John McKown
Sent: Thursday, March 02, 2017 15:32
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Transactional Execution - anybody used it?

I'm just curious. I don't, personally, have any need for it at present. I can 
envision some need for it, such as "atomically" incrementing one variable by 
some amount and decrementing another by that same amount (like
DB2 does within an SQL transaction). Or maybe updating a double linked list to 
remove a node.

I tried to see if there were any Redbooks about it, but my searches didn't find 
anything.

--
"Irrigation of the land with seawater desalinated by fusion power is ancient. 
It's called 'rain'." -- Michael McClary, in alt.fusion

Maranatha! <><
John McKown

 CSC - This is a PRIVATE message - If you are not the intended recipient, 
please delete without copying and kindly advise us by e-mail of the mistake in 
delivery.  NOTE: Regardless of content, this e-mail shall not operate to bind 
the Company to any order or other contract unless pursuant to explicit written 
agreement or government initiative expressly permitting the use of e-mail for 
such purpose.


Re: Transactional Execution - anybody used it?

2017-03-02 Thread Ngan, Robert
The " Compare and swap and double store" function of PLO?

-Original Message-
From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On 
Behalf Of John McKown
Sent: Thursday, March 02, 2017 15:32
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Transactional Execution - anybody used it?

I'm just curious. I don't, personally, have any need for it at present. I can 
envision some need for it, such as "atomically" incrementing one variable by 
some amount and decrementing another by that same amount (like
DB2 does within an SQL transaction). Or maybe updating a double linked list to 
remove a node.

I tried to see if there were any Redbooks about it, but my searches didn't find 
anything.

--
"Irrigation of the land with seawater desalinated by fusion power is ancient. 
It's called 'rain'." -- Michael McClary, in alt.fusion

Maranatha! <><
John McKown

 CSC - This is a PRIVATE message - If you are not the intended recipient, 
please delete without copying and kindly advise us by e-mail of the mistake in 
delivery.  NOTE: Regardless of content, this e-mail shall not operate to bind 
the Company to any order or other contract unless pursuant to explicit written 
agreement or government initiative expressly permitting the use of e-mail for 
such purpose.