Retrieve Processor Multitasking Information (QWCRTVPR) API


  Required Parameter Group:


Start of change  Optional Parameter Group:


  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:

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.

Start of changeOptional 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. End of change


Error Messages


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

[ Back to top | >Work Management APIs | APIs by category ]