Use this system macro to:
- Enable or disable time slicing for an entry control block (ECB)
- Assign time-slicing attributes to a time-slice name.
When an ECB is enabled for time slicing, it loses control at defined time
intervals. This allows other tasks in the TPF system to receive
control.
Required Authorizations
|
Key0
| Restricted
| System
| Common Storage
|
| X
|
|
|
Format
- label
- A symbolic name can be assigned to the macro statement.
- ENABLE
- Allow the ECB to time slice.
When the entry control block (ECB) reaches the RUNTIME value without giving
up control, it gets suspended. The ECB will remain suspended for the
value specified in the MINSUSP parameter.
- Note:
- RUNTIME and MINSUSP are values defined with the NAME parameter. If you
specify HOLD=NO and the ECB is holding a resource, the ECB will not get
suspended.
- NAME=name
- The time-slice name parameter is a 1-8 character name. The
time-slice name has four time-slice parameters associated with it. The
four parameters are RUNTIME, MAXTIME, MINSUSP, and MAXECB.
The predefined time slice names and values of the parameters associated
with them are given in Table 8.
- HOLD=YES|NO
- Indicates if the ECB can be suspended while holding a resource (FIWHC,
CORHC, ENQC, EVNWC, TASNC, SYNCC LOCK).
- Note:
- This does not apply to resources that are held with the $LOCKC macro.
- EXCD=label1
- The address to which control is passed if the maximum number of ECBs that
can be time sliced are already active for the specified time-slice
name.
- NOTFND=label2
- The address to which control is passed if the NAME parameter contains a
name that is not recognized.
- DISABLE
- Disable time slicing. Return the ECB to normal operation.
- LETRUN
- Used with the DISABLE parameter to determine if the ECB continues to run
or gives up control.
- YES
- The ECB will not lose control.
- NO
- The ECB will lose control unless time slicing is enabled with HOLD=NO and
the ECB is currently holding a resource.
- ASSIGN
- Assign time-slicing attributes to a time-slice name.
- NAME=name
- The time-slice name parameter is a 1 to 8 character name. The
time-slice name has four time-slice parameters associated with it. The
four parameters are RUNTIME, MAXTIME, MINSUSP, and MAXECB.
The predefined time-slice names and values of the parameters associated
with them are given in Table 8.
- RUNTIME=rtime
- The amount of CPU time (from 10 through 500 ms) the ECB is allowed to use
without giving up control before it is time-sliced.
- Note:
- This value cannot exceed the value that is generated by the system
initialization program (SIP) for the application timeout counter (set by IBM
to 500 ms).
- MAXTIME=mtime
- The maximum amount of accumulated runtime (from 0 ms through
9 999 999 ms) the ECB can use before taking a system
error. A value of 0 means the ECB can run indefinitely.
- MINSUSP=minsusp
- The minimum amount of time (from through 9999 ms) that the ECB will be
suspended if it is time sliced.
- MAXECB=maxecb
- The maximum number of ECBs (from through 9999) that can be active and
enabled for time slicing with this time-slice name.
Entry Requirements
- R9 contains the address of the ECB.
- This macro can only be run if the issuing program has restricted macro
usage authorization.
- The ASSIGN parameter can only be used by segment CTMS.
Return Conditions
Control returns to the next sequential instruction (NSI).
Programming Considerations
- This macro can run on any I-stream.
- This macro cannot be run while the TPF system is in restart.
- Time slicing should not be enabled throughout the life of the transaction
because there is no protection against an ECB that allows time slicing calling
a segment which does not allow time slicing.
- Time slicing should be enabled only in specific CPU-intensive code
paths. Time slicing is not supported across TPF services such as the
following because these services may be referencing shared memory, issuing
$LOCKC macros, or holding critical resources:
- SVC and fast-link macro calls
- Enters to TPF real-time segments (CYYM, CYYA, BPKD, and others)
- TPF Database Facility (TPFDF) functions.
You must ensure that time slicing is disabled before calling such system
services.
- An ECB that is enabled for time slicing must never issue a $LOCKC
macro.
- An ECB enabled for time slicing must never update a global field or other
storage areas that can be updated simultaneously by other ECBs.
- Coding LETRUN=YES is advantageous only in a highly repetitive loop where
time slicing is enabled and disabled frequently. Otherwise, to avoid
timeout errors, specify LETRUN=NO.
The ECB will exit with a system error if the ECB is not forced to give up
control and the ECB continues to run for 500 ms without giving up
control.
- An ECB enabled for time slicing and running with the HOLD=YES parameter
can hold a resource while suspended. This can cause hang
conditions. Resources held by an ECB enabled for time slicing should
not be needed elsewhere.
- An ECB enabled for time slicing can exit with a system error if the
HOLD=NO parameter is specified. This can occur if the ECB is holding a
resource (which prevents time slicing) and has been running without giving up
control for greater than the time allowed by the application timeout value
(500 ms).
- The maximum amount of accumulated runtime that an ECB enabled for time
slicing is allowed before exiting with a system error is not reset each time a
TMSLC call with the ENABLE parameter is issued. The amount of time set
with the MAXTIME parameter must allow the ECB to complete its task.
- ECBs that are suspended because of a TMSLC call will be purged during
system cycle-down to 1052 state unless they have been previously identified to
survive cycle-down.
- Resource control is shipped with three predefined time-slice names.
Table 8 shows the predefined time-slice names and values of the
parameters associated with them.
Table 8. Time Slice Name Table
Time Slice Name
| Values
|
| RUNTIME
| MAXTIME
| MINSUSP
| MAXECB
|
IBMLOPRI
| 50 ms
| 20000 ms
| 1000 ms
| 50
|
IBMHIPRI
| 100 ms
| 10000 ms
| 100 ms
| 50
|
IBMINDEF
| 50 ms
| 0 ms
| 2000 ms
| 20
|
Notes:
- These are the values for the time-slice name parameters as shipped by
IBM.
- IBMLOPRI, IBMHIPRI, and IBMINDEF are reserved for use by IBM.
- To add new time-slice names, use the ZTMSL command or the TMSLC macro with
the ASSIGN parameter. The ZTMSL command can also be used to display,
change, and remove time-slice names.
Examples
- This call to the TMSLC macro:
- Enables the ECB for time slicing based on the parameters associated with
the time-slice name of BIGSORT,
- Returns control to label WARNUSER if too many ECBs are enabled for time
slicing under the time-slice name BIGSORT,
- Indicates the ECB is not allowed to be suspended while holding a resource,
and
- Branches to BADNAME, if the TMSLC macro does not recognize the time-slice
name BIGSORT.
TMSLC ENABLE,NAME=BIGSORT,HOLD=NO,EXCD=WARNUSER,NOTFND=BADNAME
- This call to the TMSLC macro creates an entry for the IBMXYZ name in the
time-slice name table during system restart. The entry is initialized
with the following attributes:
- Set the maximum time that ECBs can run continuously to 300 ms.
- Set the maximum amount of accumulated runtime that ECBs can use to 5000
ms.
- If suspended because of a time slice, suspend ECBs for 1000 ms.
- Allow no more than 500 ECBs to be enabled for time slicing with the IBMXYZ
time-slice name.
TMSLC ASSIGN,NAME=IBMXYZ,RUNTIME=300,MAXTIME=5000,MINSUSP=1000,MAXECB=500
- This call to the TMSLC macro does not allow the ECB to be time
sliced. Upon return, the ECB will not be able to be time sliced and
will act as a normal transaction ECB.
The ECB will lose control unless it was enabled with HOLD=NO and is
currently holding a resource. Time-slicing is disabled when updating
global storage, when entering $LOCKC macro calls, when holding
performance-critical records, and so on.
TMSLC DISABLE,LETRUN=NO