Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Begin_Context (CTXBEGC, CTX4BEGC) z/OS MVS Programming: Resource Recovery SA23-1395-00 |
|||||||||||||||||||||||||||||||||||||||||||||||
A resource manager calls the Begin_Context service to create a privately-managed context. Begin_Context is intended for use in a program that manages work on behalf of another program or user. The program accepts the responsibility to manage the environment for the other program. In response to the call, context services returns:
Contexts: A context represents
the resources for a work request; a context consists of the application
program requesting the work and the protected resources involved in
the work. The two types of contexts are:
An application's task has a native context associated with it. A resource manager can use a call to the Begin_Context service to obtain a privately-managed context, then use a call to the Switch_Context service to associate the privately-managed context with a task. While the privately-managed context is associated with a task, interactions with the application are related to the privately-managed context. Later, the resource manager can use a call to the Switch_Context service to disassociate the privately-managed context; subsequent interactions are related to the native context for the task. Current context: The native context is the original current context for an application's task. A Begin_Context call obtains a privately-managed context, and a call to Switch_Context associates the privately-managed context with the application; the native context still exists but is not current. The privately-managed context is the current context. If a call to the Switch_Context service later disassociates the privately-managed context, the native context again becomes the current context. Context token: The
context token is a random value that is not preserved across restarts
of the system, exit manager, or resource manager. Thus:
EnvironmentThe requirements for the resource manager are:
Programming requirementsThe resource manager's object code must be linked with the linkable stub routine CTXCSS (31 bit) or CTX4CSS (64 bit) from SYS1.CSSLIB. The high level language (HLL) definitions for the callable service are:
RestrictionsTo call the service, the resource manager associated with the resource manager token specified in the call must be in set state, which means it has registered and called the Set_Exit_Information service, specifying context services as the exit manager. Resource managers that are PKM 8–15 problem state must register using the Register_Resource_Manager service from the home address space before invoking this service. They must specify a resource manager token of a key 8–15 problem state resource manager which registered from the home address space. If a PKM 8–15 problem state resource manager attempts to create a context and doing so will result in the PKM 8–15 problem state resource manager registered in the space owning more than 256 contexts per unauthorized resource manager, context services will request confirmation of the request from a system operator. If the operator allows the request, the PKM 8–15 problem state resource managers registered in the space will be able to create as many contexts as they want. If the operator does not allow the request, a context will not be returned. Input register informationBefore issuing the call, the resource manager does not have to place any information into any register unless using it in register notation for the parameters, or using it as a base register. Output register informationWhen control
returns to the resource manager, the GPRs contain:
When control returns to the resource manager,
the ARs contain:
Some resource managers depend on register contents remaining the same before and after issuing a call. If the system changes the contents of registers on which the resource manager depends, the resource manager must save them before calling the service, and restore them after the system returns control. Performance implicationsNone. SyntaxWrite the call as shown in the syntax diagram. You must code the parameters in the CALL statement as shown.
ParametersThe parameters are explained
as follows:
ABEND codesThe call might result in an abend X'AC7' with a reason code of either X'00110000' or X'00110001'. See z/OS MVS System Codes for the explanations and actions. Return codesWhen the service returns control to the resource manager, GPR 15 and return_code contain a hexadecimal return code.
ExampleIn the pseudocode example, the
resource manager issues a call to create a private context. Storage
for the call parameters has been allocated.
|
Copyright IBM Corporation 1990, 2014
|