View previous topic :: View next topic
|
Author |
Message |
Thanatopsis
New User
Joined: 02 Dec 2010 Posts: 7 Location: Houston
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
Back to top |
|
|
Ronald Burr
Active User
Joined: 22 Oct 2009 Posts: 293 Location: U.S.A.
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
Thanatopsis
New User
Joined: 02 Dec 2010 Posts: 7 Location: Houston
|
|
|
|
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 |
|
|
|