[comp.os.vms] SMG routines / Broadcast Messages / ASTs

nagy%warner.hepnet@LBL.ARPA.UUCP (09/12/87)

>I want to use the SMG$ routines for both input and output.  I also want
>to trap and retrieve broadcast messages using the SMG$SET_BROADCAST_TRAPPING
>routine.  When the broadcast AST goes off, I want to retrieve the messages
>and write them to the screen using the SMG routines.  The problem is that
>if the program is in the SMG routines when the trap goes off, I end up
>calling the SMG routines recursively and the program aborts.
     
Nope, we ran into the same problem.  In fact, a bit of research turned
up the following:

	It is important to note that Screen Management procedures
	are not AST reentrant.

on page 3-24 (second sentence of section 3.9) in the Run-Time Library
Routines Part I and Part II Through LIB$.  The bedevilment is that
Digital's own examples in the manuals - see the example with the
SMG$DISABLE_BROADCAST_TRAPPING on page RTL-590..595.  Don't you just
want to scream :-)

Our solution to such things has been to use the AST routines to set flags
or queue "event buffers" in a processing queue and then wakeup the main
routine (which is usually $HIBERing).  This seems to work quite well.


= Frank J. Nagy   "VAX Guru"
= Fermilab Research Division EED/Controls
= HEPNET: WARNER::NAGY (43198::NAGY) or FNAL::NAGY (43009::NAGY)
= BitNet: NAGY@FNAL
= USnail: Fermilab POB 500 MS/220 Batavia, IL 60510