HPlogo MPE/iX Intrinsics Reference Manual > Chapter 6 Command Definitions (FLUSHLOG-GETUSERMODE)

GETPRIORITY

MPE documents

Complete PDF
Table of Contents
Index

Edition 7 E0701 ♥
Edition 7 E0300
Edition 6 E0195

NM and CM callable.

Changes the priority of a process. Process handling (PH) capability is required.

Syntax



               I16V U16V           I16V
  GETPRIORITY (pin, priorityclass, rank);

Parameters


pin

16-bit signed integer by value (required)

Passes the process whose priority is to be changed. To specify the calling process, set pin to zero. To specify a child process, set pin to the process identification number (PIN) of a child process.

priorityclass

16-bit unsigned integer by value (required)

Contains the priority class in which the new process is scheduled (AS, BS, CS, DS, ES), computed in the following manner:


   (ASCII of first character * 256) +
   (ASCII of second character)

The integer equivalents are:

   Ascii Decimal Hex    Octal 
    AS = 16,723  $4153  %040523
    BS = 16,979  $4253  %041123
    CS = 17,235  $4353  %041523
    DS = 17,491  $4453  %042123
    ES = 17,747  $4553  %042523

Aborts the calling process if priorityclass exceeds the maximum allowable priority class of the rescheduled process or specifies an invalid priority class.

Specify any priority class except AS, if in user mode; this function is limited by the maximum priority assigned to the account by the system manager. If in privileged mode, processes can be scheduled into all subqueues including AS. Processes in the linear queues, AS or BS, do not give up the CPU voluntarily; it could loop indefinitely and prevent other processes from accessing the CPU.

If in privileged mode, specify the priorityclass parameter as an absolute priority by xA, where x is an 8-bit priority number and A is the ASCII character A. For example, to request a priority class of 31 in the master queue, set priorityclass to %017501. An absolute priority must be specified in order to overcome the MAXPRI setting of an account.

Default: The priority class of the calling process


NOTE: Scheduling a process into the AS or BS priority class can result in the rescheduled process deadlocking the system or locking out system and user processes from execution.

rank

16-bit signed integer by value (optional)

Used for backward-compatibility with pre-MPE IV operating systems only.

Operation Notes


A process must be running in privileged mode to specify absolute priority.

A process can change its own priority or that of its child, but it cannot reschedule its parent.

Condition Codes


CCE (2)Request granted.
CCG (0)Request denied. The process specified is not currently accessible (for example, unborn or dying).
CCL (1)Request denied. An illegal or invalid PIN was specified.

Related Information


IntrinsicsGETINFO, GETPROCINFO, HPMYFILE, HPMYPROGRAM, JOBINFO, PROCINFO, PROCTIME, WHO
Manuals Process Management Programmer's Guide




GETORIGIN


GETPRIVMODE