(go to: table of contents, index, list of vms_sys, prev: SUBSYSTEM, next: TIMCON)
Format:
Please note: if you do a SUSPND on your own process, then it will 'hang'.
You must issue a RESUME() from a different
process to continue. And _after that_, you will get the 'targpid' value back
(which, of course, is your own PID).
SUSPND - Suspend Process
Allows a process to suspend itself or another process. Execution can
be resumed with the vms_sys.resume() service.
Warning! A process that has suspended itself can only be resumed from a
different one.
28-SEP-1998 ZE.
targpid = vms_sys.suspnd ([pidadr] [,prcnam] [,flags])
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.suspnd() raises a Python exception.
Examples:
>>> import vms_sys
>>> # suspend current process
>>> # Note: resume can only be done from a different process!
>>> print vms_sys.suspnd ()
(process 'hangs')
91 <-- PID of current process
it was resumed via: >>> vms_sys.resume (91)
from a different process
>>> print vms_sys.suspnd (None)
(process 'hangs')
91 <-- PID of current process is printed after
it was resumed via: >>> vms_sys.resume (91)
from a different process
>>> targ_pid = 93
>>> print vms_sys.suspnd (targ_pid)
93 <-- PID of target process
this process now 'hangs'
>>> vms_sys.resume (targ_pid)
93 <-- PID of target process
this process now continues
>>> print vms_sys.suspnd (0,"TARG_PRC")
93 <-- PID of target process
this process now 'hangs'
>>> vms_sys.resume (targ_pid)
93 <-- PID of target process
this process now continues
>>> # this example uses the PID that is returned
>>> targ_pid = vms_sys.suspnd (None,"TARG_PRC")
(target process 'hangs')
>>> print targ_pid
95 <-- PID of target process
>>> vms_sys.resume (targ_pid)
95 <-- PID of target process
this process now continues
* the flags argument cannot be used from Python because
it runs in all user-mode code.
>>> nonexist_pid = 9999
>>> print vms_sys.suspnd (nonexist_pid)
Traceback (innermost last):
File "<stdin>", line 1, in ?
vms_sys.error: (2280, '%SYSTEM-W-NONEXPR, nonexistent process')
>>> print vms_sys.suspnd (None,"NO_SUCH_PRC")
Traceback (innermost last):
File "<stdin>", line 1, in ?
vms_sys.error: (2280, '%SYSTEM-W-NONEXPR, nonexistent process')
>>>
(go to: table of contents,
index,
list of vms_sys,
prev: SUBSYSTEM,
next: TIMCON)