(go to: table of contents, index, list of vms_sys, prev: SETEF, next: SETPRN)
@@ SETPRI - Argument 4 not tested yet (23-MAY-1998) on OpenVMS Alpha.
Format:
SETPRI - Set Priority
Changes the base priority of the process. The base priority is used
to determine the order in which executable processes are to run.
28-SEP-1998 ZE.
targpid, previous_priority, previous_policy = vms_sys.setpri \
([pid], [prcnam], priority [, policy])
Returns:
Arguments:
The targed PID (targpid) is always returned - it is as if you have specified
a '0' value for the 'pidadr' argument.
If an error happens, then vms_sys.setpri() raises a Python exception.
Examples:
(Alpha only - this argument is ignored on VAX)
>>> import vms_sys
>>> # lower priority using explicit PID
>>> print vms_sys.setpri (91,None,3)
(91, 4, 0)
>>> # set back old priority usind default PID
>>> vms_sys.setpri (0,None,4)
(91, 3, 0)
>>> vms_sys.setpri (None,None,3)
(91, 4, 0)
>>> vms_sys.setpri (None,"TARG_PRC",3)
(93, 4, 0)
^^ <-- PID of target process returned even if name was given
>>> vms_sys.setpri ()
Traceback (innermost last):
File "<stdin>", line 1, in ?
TypeError: function requires at least 3 arguments; 0 given
>>> vms_sys.setpri (0,None)
Traceback (innermost last):
File "<stdin>", line 1, in ?
TypeError: function requires at least 3 arguments; 2 given
>>> vms_sys.setpri (1,2,3)
Traceback (innermost last):
File "<stdin>", line 1, in ?
TypeError: argument 2: expected read-only buffer, int found
>>> nonexist_pid = 9999
>>> vms_sys.setpri (nonexist_pid,None,4)
Traceback (innermost last):
File "<stdin>", line 1, in ?
vms_sys.error: (2280, '%SYSTEM-W-NONEXPR, nonexistent process')
>>> vms_sys.setpri (None,'NONEXPRC',4)
Traceback (innermost last):
File "<stdin>", line 1, in ?
vms_sys.error: (2280, '%SYSTEM-W-NONEXPR, nonexistent process')
>>> vms_sys.setpri (__name__,'X',4)
Traceback (innermost last):
File "<stdin>", line 1, in ?
TypeError: argument 1: pidadr - must be integer or None
>>>
(go to: table of contents,
index,
list of vms_sys,
prev: SETEF,
next: SETPRN)