Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

MWAIT a process for testing

SOLVED
Go to solution
Chuck Smith_5
Occasional Visitor

MWAIT a process for testing

I am working on a monitor for processes in MWAIT and to test it I need to force a process to stay in MWAIT. Any idea how to do this?
7 REPLIES
Jess Goodman
Esteemed Contributor
Solution

Re: MWAIT a process for testing

First, just to be clear, MWAIT is a VMS scheduling state that encompasses several system states including MUTEX and all the various RW* (resource wait) states.

The SHOW SYSTEM command will display the underlying system state for MWAIT processes.
even though F$GETJPI(pid,"STATE") will return "MWAIT". SHOW PROCESS for a MWAIT process returns the misleading error:
%SYSTEM-F-SUSPENDED, process is suspended
even though suspended is a completely different scheduling statae.

But to answer your question: The easiest MWAIT state to get a process into is probably the RWMBX state.

Create a test mailbox specifying a fairly small BUFQUO. This is easy to do with a quick program that calls SYS$CREMBX, or you can use the freeware MBU package.

Fill the mailbox up by COPYing a file into it from one process. That process will hang in LEF state. Then from a second process just use DCL to OPEN TEST TESTMBX: and WRITE TEST "string". Before you can ask "Why didn't they just use LEF instead of RWMBX?", BAM, you're in a MWAIT state.
I have one, but it's personal.
Jim_McKinney
Honored Contributor

Re: MWAIT a process for testing

Fetch Nick de Smith's MWAIT package from http://vms.process.com/scripts/fileserv/fileserv.com?MWAIT. He's generously provided several test programs that create a variety of MWAIT conditions.
Ian Miller.
Honored Contributor

Re: MWAIT a process for testing

Instead of writing your own monitor consider using Availability Manager or AMDS.

http://h71000.www7.hp.com/openvms/products/availman/index.html

Not only will this detect processes in various resource wait conditions it can also fix them by adjusting quotas :-)
____________________
Purely Personal Opinion
Chuck Smith_5
Occasional Visitor

Re: MWAIT a process for testing

Many thanks to all who replied. I am not writing my own monitor, I am testing SENSys from TECSys. I know that SENSys will catch processes in MWAIT but I made an slight change to how it notifies on an MWAIT and do not want to wait for a user to help me with my testing. :)
John Gillings
Honored Contributor

Re: MWAIT a process for testing

Chuck,

I've attached a MACRO32 program which posts TQEs in an infinite loop, this will rapidly put the process into a MUTEX wait state - as soon as you reach TQELM. It will briefly drop out of MUTEX every second, as one of the TQEs expires and the next is posted.

This particular MWAIT is fairly safe as you can easily STOP the process.
A crucible of informative mistakes
Wim Van den Wyngaert
Honored Contributor

Re: MWAIT a process for testing

Don't agree with Ian. What you write yopurself, you have under control.

I wrote monitoring of MWAIT processes too. There are situations were this is normal (stock exchange applic with heavy mailbox usage). I have to see mwait 50 times every 5 seconds before I create an alarm.

I have such mechanisms and exceptions ony many alarms.

Btw : my alarms stay when the problem is gone. Just don't want any alarms that are not true.

Wim

Wim
Ian Miller.
Honored Contributor

Re: MWAIT a process for testing

with Availability manager you can set how often a particular condition has to be seen before it is reported and how important it is.

However there are many ways to do the same thing so people use the one that best suits their requirements.

____________________
Purely Personal Opinion