Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

very small mutex in ASM

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: very small mutex in ASM
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Sat Dec 04, 2010 2:09 am    Post subject: Reply to: very small mutex in ASM
Reply with quote

CS CDS and friends
for z/Architecture Principles of Operation, SA22-7832-08 see
http://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    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Sat Dec 04, 2010 3:20 am    Post subject: Reply to: very small mutex in ASM
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts PL/I small integer? John Poulakos PL/I & Assembler 3 Wed Dec 24, 2014 2:22 am
No new posts Create a small subset of MAN dataset vasanthz All Other Mainframe Topics 5 Fri Nov 15, 2013 2:16 am
No new posts A small request again Pandora-Box General Talk & Fun Stuff 0 Wed Mar 13, 2013 12:24 pm
No new posts Split file into 10 small files with H... purbasha JCL & VSAM 2 Thu Feb 14, 2013 6:17 pm
No new posts Have a small break! Anuj Dhawan General Talk & Fun Stuff 5 Tue Sep 18, 2012 2:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us