Retrieve Processor Multitasking Information (QWCRTVPR) API
Required Parameter Group:
1 | Configured maximum number of secondary threads per processor | Output | Binary(4) |
2 | Error code | I/O | Char(*) |
Optional Parameter Group:
3 | Current number of secondary threads per processor | Output | Binary(4) |
4 | Maximum number of secondary threads per processor | Output | Binary(4) |
Default Public Authority: *EXCLUDE
Threadsafe: No
The Retrieve Processor Multitasking Information (QWCRTVPR) API can be used to retrieve the configured maximum, current and maximum number of secondary hardware threads per processor. See the processor multitasking (QPRCMLTTSK) system value for more information on simultaneous multithreading. Use the Change Processor Multitasking Information (QWCCHGPR) API to limit the number or processing threads.
Authorities and Locks
This API is shipped with *EXCLUDE public authority.
To use this API you must be explicitly authorized to the API, or call the API from a program that
adopts enough authority to call the API.
Required Parameter Group
- Configured maximum number of secondary threads per processor
- OUTPUT; BINARY(4)
The configured maximum number of secondary hardware threads per processor that may be active. Note that the value returned is the maximum number of secondary threads configured using the Change Processor Multitasking Information (QWCCHGPR) API. Possible values returned are:
0 The system may use the maximum number of processor threads that the hardware supports. 1-255 The system may use up to the indicated maximum number of secondary threads per processor. There is always at least one processor thread used per active processor. This value represents the number of additional threads per processor that may be active at the same time. - Error code
- I/O; CHAR(*)
The structure in which to return error information. For the format of the structure, see Error code parameter.
Optional Parameter Group
- Current number of secondary threads per processor
- OUTPUT; BINARY(4)
The number of secondary hardware threads per processor that are currently active.
- Maximum number of secondary threads per processor
- OUTPUT; BINARY(4)
The maximum number of secondary hardware threads per processor. This is the maximum number of secondary hardware threads per processor irrespective of the configured maximum number of secondary threads per processor.
Error Messages
Message ID | Error Message Text |
---|---|
CPF24B4 E | Severe error while addressing parameter list. |
CPF3CF1 E | Error code parameter not valid. |
CPF3CF2 E | Error(s) occurred during running of &1 API. |
CPF9872 E | Program or service program &1 in library &2 ended. Reason code &3. |
Example
Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.
/*******************************************************************/ /* This program calls the QWCRTVPR API to retrieve the maximum */ /* number of secondary threads per processor and sends a CPF9898 */ /* message to the display with the result. */ /* */ /* To compile program: */ /* CRTCLPGM OBJ(QGPL/RTVPRCXMP) SRCFILE(QGPL/QCLSRC) */ /* */ /* To invoke program: */ /* CALL QGPL/RTVPRCXMP */ /*******************************************************************/ PGM DCL VAR(&MAXTHD) TYPE(*INT) LEN(4) DCL VAR(&MAXTHDC) TYPE(*CHAR) LEN(4) DCL VAR(&IDX) TYPE(*INT) LEN(2) DCL VAR(&ERR) TYPE(*CHAR) LEN(8) VALUE(X'0000000000000000') DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(52) + VALUE('The maximum secondary threads per processor is: ') /************************************************************/ /* Call the retrieve processor multitasking information API */ /************************************************************/ CALL QSYS/QWCRTVPR PARM(&MAXTHD &ERR) /************************************************************/ /* Format the data returned by the API for the message */ /************************************************************/ CHGVAR VAR(&MAXTHDC) VALUE(&MAXTHD) DOFOR &IDX FROM(1) TO(3) IF COND(%SST(&MAXTHDC &IDX 1) *EQ '0') + THEN(CHGVAR VAR(%SST(&MAXTHDC &IDX 1)) VALUE(' ')) ENDDO /************************************************************/ /* Send a message to the display */ /************************************************************/ CHGVAR VAR(%SST(&MSGDTA 49 4)) VALUE(&MAXTHDC) SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA(&MSGDTA) ENDPGM
API introduced: V7R1 by PTF