(A very delayed follow-up on a thread from yesteryear...)

tl;dr: In unauthorized code, ECBs are much faster than pause elements.

I wrote a simple test program to compare the performance of WAIT/POST and pause 
elements. The program has two tasks and simply ping-pongs back and forth 
between them (no overlapped execution). Each task has a synchronization gadget, 
either an ECB or a pause element. The tasks use each other's synchronization 
gadget to just transfer control back and forth between each other in a loop. 
This is a pretty unrealistic test (in terms of being like anything "real" code 
would do), but it does illustrate the relative performance of the two 
synchronization methods.

Note that this unauthorized code, and tasks, not SRBs This means that all of 
the synchronization primitives used SVCs, not branch entry points. The code is 
64-bit C++ compiled with xlC using -q64 and thread_create() to create the 
tasks. The code is running on a z13, native LPAR, z/OS 2.2.

The mechanisms I tested are:

* ECBs: each task just alternates between a WAIT on its own ECB and a POST of 
the other task's ECB.
* Pause elements with Pause (iea4pse) and Release (iea4rls) taking the role of 
WAIT and POST.
* Pause elements using Transfer (iea4xfr) in "transfer and pause" mode (one 
call to do both).
* Pause elements using Transfer (iea4xfr) in "just transfer" mode followed by 
Pause (iea4pse).

Here are the results:

Relative performance: total CPU
ECB                           1.0
Pause/Resume                  4.30
Transfer and Pause            3.25
Transfer with separate Pause  4.55

Relative performance: elapsed
ECB                           1.0
Pause/Resume                  6.06
Transfer and Pause            4.75
Transfer with separate Pause  6.28

-- Jerry

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

Reply via email to