Product SiteDocumentation Site

12.4. Using Additional Concurrency Mechanisms

Rexx has additional concurrency mechanisms that can add full concurrency so that more than one method of a given scope can run in an object at a time:

12.4.1. SETUNGUARDED Method and UNGUARDED Option

The SETUNGUARDED method of the Method class and the UNGUARDED option of the ::METHOD directive control locking of an object's scope when a method is invoked. Both let a method run even if another method is active on the same object.
Use the SETUNGUARDED method or UNGUARDED option only for methods that do not need exclusive use of their object variable pool, that is, methods whose execution can interleave with another method's execution without affecting the object's integrity. Otherwise, concurrent methods can produce unexpected results.
To use the SETUNGUARDED method for a method you have created with the NEW method of the Method class, you specify:
methodname~SETUNGUARDED
(See Section 5.1.4.13, “setUnguarded” for details about SETUNGUARDED.)
Alternately, you can define a method with the ::METHOD directive, specifying the UNGUARDED option:
::METHOD methodname UNGUARDED