IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

very small mutex in ASM


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Thanatopsis

New User


Joined: 02 Dec 2010
Posts: 7
Location: Houston

PostPosted: Sat Dec 04, 2010 1:57 am
Reply with quote

I'm working on a semi-reentrant assembler routine. Its fully reentrant with the exception of a small amount of working storage that they share (one of the parameters).

I happen to know there will be at most one other thread running this same csect. So that might help simplify things a bit.

I'm looking for a way to establish mutual exclusion with my code. Its to protect a single MVC instruction from rare conditions between the two threads. Something as simple as a semaphore I can implement would do the trick. For the life of me I can't even find which instructions are atomic (if any, I know several that are NOT.)

I wondered if anyone has done this sort of thing before? I appreciate any suggestions. Thanks.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Dec 04, 2010 2:09 am
Reply with quote

CS CDS and friends
for z/Architecture Principles of Operation, SA22-7832-08 see
www.vm.ibm.com/devpages/jelliott/cmosproc.html
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Sat Dec 04, 2010 2:35 am
Reply with quote

From the Assembler Services Guide:

Preventing simultaneous use of the same copy when you have more than one task in the job step requires more effort on your part. You must still be sure that the logic of the program for each task does not require a second use of the same load module before completion of the first use. You must also be sure that no more than one task requires the use of the same copy of the load module at one time. You can use the ENQ macro for this purpose. Properly used, the ENQ macro prevents the use of a serially reusable resource, in this case a load module, by more than one task at a time. For information on the ENQ macro, see Chapter 6, "Resource control" in topic 6.0 You can also use a conditional ENQ macro to check for simultaneous use of a serially reusable resource within one task.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Sat Dec 04, 2010 3:20 am
Reply with quote

You may also want to review "Conditional Swapping Instructions", CS (Compare and Swap) and CDS (Compare Double and Swap) as they theoretically perform the same function as an ENQ.

You can find them in the POPS Manual....

Bill
Back to top
View user's profile Send private message
Thanatopsis

New User


Joined: 02 Dec 2010
Posts: 7
Location: Houston

PostPosted: Mon Dec 06, 2010 11:02 pm
Reply with quote

Concurrency is one topic I haven't worked with much in a mainframe setting. Thanks a ton for the input. This was exactly what I was looking for.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Split large FB file based on Key coun... DFSORT/ICETOOL 4
No new posts PL/I small integer? PL/I & Assembler 3
No new posts Create a small subset of MAN dataset All Other Mainframe Topics 5
No new posts A small request again General Talk & Fun Stuff 0
No new posts Split file into 10 small files with H... JCL & VSAM 2
Search our Forums:

Back to Top