HP OpenVMS Systems

ask the wizard
Content starts here

Resolving process in MWAIT/RWAST wait state?

» close window

The Question is:

 
We have a process in RWAST state. Until the system will be booted (it's a
 production system), we are only monitoring that process. In the monitor (com
 file), we used the f$getjpi lexical function.
And the question is:
Why the resualt of that lexical with this process gives a MWAIT result, while
 the process is in RWAST for days?
------------------------------------------------
Some snapshots:
>sh sys/stat=rwast
OpenVMS V7.1  on node F18WS4   4-FEB-2001 08:54:48.42  Uptime  88 16:06:45
  Pid    Process Name    State  Pri      I/O       CPU       Page flts  Pages
20E3662F RIA.sc.1.4      RWAST    7    23308   0 00:01:39.80      3999   5549
>state == f$getjpi("20E3662F","state")
>sh sym state
  STATE == "MWAIT"
 
 
Thx,
Iris
 


The Answer is :

 
    The state "MWAIT" stands for "Miscellaneous WAIT state". This is a
    generic category which includes a number of "sub states", one of which
    is RWAST. RWAST stands for "Resource Wait Asynchronous System Trap"
    which indicates that the process is waiting for a resource, the
    availability of which is expected to be reported by an AST being
    delivered to the process. For processes in MWAIT state, the substate is
    indicated by the value in the event flag wait mask (JPI code EFWM). The
    values of the substates can be found in the macro $RSNDEF from LIB.MLB
 
    Some utilities, like SHOW SYSTEM, decode the MWAIT states into substates.
    Others do not. Still others, such as SHOW PROCESS/CONTINUOUS, report an
    MWAIT process as "suspended".
 
    The following command procedure will determine the state string for a
    process, including substates of MWAIT. Note that since F$GETJPI needs
    to be called twice, it is possible for the target process to change
    states between the calls. RSN states are derived from an OpenVMS/Alpha
    V7.2-1 system. In this example the process state is printed, returning
    the string to the caller left as an exercise for the reader.
 
PSTATE.COM
$ IF p1.EQS."" THEN INQUIRE p1 "PID"
$ state=F$GETJPI(p1,"STATE")
$ efwm=F$GETJPI(p1,"EFWM")
$ IF state.EQS."MWAIT" THEN state=F$ELEMENT(efwm,"/",-
     "/RWAST/RWMBX/RWNPG/RWPFF/RWPAG/RWBRK/RWIMG/RWQUO/RWLCK/RWSWP"+-
     "/RWMPE/RWMPB/RWSCS/RWCLU/RWCAP/RWCSV/RWSNP/RWXFR/RWINS/RWEXH/")
$ IF state.EQS."".OR.state.EQS."/" THEN state="MWAIT" ! Unrecognised EFWM value
$ SHOW SYM state
$ EXIT
 
  Related topics here in Ask The Wizard include (6), (2347), (5841),
  and (7120).
 
 

answer written or last revised on ( 3-OCT-2001 )

» close window