ROLOUT Function

The ROLOUT function enables an application program to relinquish the use of the thread by requesting that a thread rollout occur. Thread rollouts are required to enable the sharing of thread resources by more than one application program.

When Com-plete is initialized, a maximum CPU time value is assigned to each thread. If an application program uses this maximum value before a rollout occurs, the program terminated abnormally.

Thread rollout normally occurs when an application program uses a terminal I/O function (e.g., WRTC); however, if an application program performs multiple compute-bound or I/O-bound functions prior to using a terminal I/O function, it may exceed the time allotted and abnormally terminate. Use of the ROLOUT function enables the application program to avoid abnormal termination by forcing the thread rollout to occur.

When a thread rollout occurs, the program in the thread is placed at the end of the Com-plete ready-to-run queue, and the application program at the top of the queue is dispatched for execution. If the ready-to-run queue is empty (no program is awaiting execution), a rollout does not occur. Note that this is true even if the ROLOUT function is specifically requested.

The application program can optionally choose to request that the thread rollout occur and that (after a specified number of seconds) the application program be placed at the bottom of the Com-plete ready-to-run queue to await dispatching for execution. This is called a timed rollout request.

Format

The format for using the ROLOUT function is:

ROLOUT [(time)]
time Optional.
Default: 0A binary halfword containing the number of seconds after which the application program is placed at the bottom of the Com-plete ready-to-run queue to await dispatching for execution.
Return Codes

There are no return codes associated with the ROLOUT function.

Abends

There are no abnormal termination situations that can be directly associated with the ROLOUT function.