Operating System - OpenVMS

Need help regarding AST.

Not applicable

Need help regarding AST.


I require some help regarding AST.
I need to trigger AST without waiting for any event flag to set. For this I make use of $SETIMR giving 0 sec. as the argument but there is one drawback for this system call we can not provide provide the arguments to the AST which we want to trigger.

Could any one help me to know how can we trigger an AST in between the normal code flow (same as function call) and we also require to pass the arguments to the triggered AST.

Hein van den Heuvel
Honored Contributor

Re: Need help regarding AST.

Use th esystm service $DCLAST : Declare AST.

You have 1 Ast Parameter : ASTPRM

That astprm can be a pointer to a structure with more argument or an index into a table or an encoded name, or a (short) piece of string to help the ast routine decode what to do next, and where to find the data.


Honored Contributor

Re: Need help regarding AST.

ASTs are not related to event flags.

These two synchronization mechanisms can be seen used together and there are some sequencing rules around delivery (if and when specified, the the EF is always set and the IOSB is always filled in before the AST is delivered), but the two constructs are basically unrelated.

Here's a write-up:

The article has a code example of calling the sys$$dclast system service to trigger an AST, in addition to introductory material (and caveats) around ASTs and AST programming.

In particular, any data shared between the mainline and the AST must be accessed with some care.
Robert Gezelter
Honored Contributor

Re: Need help regarding AST.


As has been observed, the correct (most clear, and least effort) way to force an AST to occur is through the use of $DCLAST. The $DCLAST call does include an additional parameter that is passed through to the AST routine (which is also available in the $SETIMR case, although I seem to recall that it is labeled as "Timer ID").

I can recommend my presentation "Introduction to AST Programming" (notes available via http://www.rlgsc.com/decus/usf95/index.html ; I am in the midst of a long term overhaul of my site's structure, so the index page is the most reliable citation) from the Fall 1995 US DECUS Symposium.

- Bob Gezelter, http://www.rlgsc.com