[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

443.0. "AST and CHF" by CHAMBR::GUINEAU () Tue Apr 14 1987 12:17


 I'm working on a non-transparent incomming network link server which
 basically sets itself up as a network object and queues an AST to DECNET
 and hibernates. When an incomming request comes, it verifys the link,
 updates the link database, confirms the link and issues readvblk AST to
 a the (oh yeh, associates a channel also) channel. 

 Basically, once everything is set up, ASTs do all the work.

 I am just learning condition handling and exclusive use of ASTs so please
 bare  with me for this one.



  If I signal a condition from an AST and unwind within the CH, does the
  AST get unwound? (It dosen't seem to).

  
  Is there a way to get the functionality of $PUTMSG without actually
  printing the message.  I know I could parse the signal stack myself,
  but PUTMSG does a nice job. Right now I print the message but I would
  eventually like to send all the signal info to a mailbox for another
  (the main) process to deal with.


  John
T.RTitleUserPersonal
Name
DateLines
443.1Try this for messages.FROST::HARRIMANDialogue...DuologueTue Apr 14 1987 13:1711
>      Is there a way to get the functionality of $PUTMSG without actually
>  printing the message.  I know I could parse the signal stack myself,
>  but PUTMSG does a nice job. Right now I print the message but I would
>  eventually like to send all the signal info to a mailbox for another
>  (the main) process to deal with.

 
    The system service $GETMSG is the actual call - $PUTMSG will output
    to SYS$OUTPUT but $GETMSG will simply store the message text in
    a buffer. Does more than that but only if you tell it to. See the
    System Services manual.
443.2CHAMBR::GUINEAUTue Apr 14 1987 14:2214




 But $GETMSG dosen't fill in FAO directives.

 In the Condition Handler I get a SIG[n] signal stack which has messages
 and FAO arguments. 

 Guess I have to either live without the FAOs or do them myself.


 John
443.3VMS has it NOW!FROST::HARRIMANDialogue...DuologueTue Apr 14 1987 14:4915
    
    Yes, but $GETMSG *does* tell you how many FAO arguments it thinks
    you should have. Since the message text will be in a buffer you
    can the do the FAO yourself, using the count that $GETMSG returns
    to you ("outadr", byte 1). You said you didn't want to output them,
    right? All you have to do to output them is to $FAO the message
    with the FAO count supplied by $GETMSG, and yank 'em off your stack.
    
    You could even get around that by doing a $FAOL into another buffer,
    once you got the message... You already appear to have your arguments
    on the stack, it's not that difficult to make $FAOL take arguments.
    
    You cartainly don't HAVE to do them yourself!
    
    /pjh
443.4Try an ACTRTNKATYA::FISHERBill FisherTue Apr 14 1987 15:015
I thought that executing an action routine which returned with LBC would
keep $PUTMSG from writing to SYS$OUTPUT and SYS$ERROR.  The description of
$PUTMSG doesn't seem to state this, but the FORTRAN example indicates that
it works that way.

443.5use $PUTMSG with action routineSQM::RICOTue Apr 14 1987 16:197
    .4 is correct.  I have an application that uses $PUTMSG to format
    messages and ship them through a mailbox.  Exiting your action
    routine with a "failure" status (LBC) with prevent $PUTMSG
    from writing to SYS$OUTPUT or SYS$ERROR.  This is not documented
    that I can see so I don't know if it could change in the future.

            Rico
443.6SolvedCHAMBR::GUINEAUTue Apr 14 1987 16:3311


  Thats it!   I think PUTMSG with an ACTRTN is the way to go.


  Thanks !


 John

443.7CHF questionsCASEE::COWANKen CowanFri May 01 1987 16:3012
    As for the other question, yes you can unwind through AST routines,
    but you have to be careful.  Some parts of VMS don't like asynchronous
    unwinds.
    
    I suspect you want to unwind the AST, and no further.   This is
    the normal case.   To do that, have your AST routine enable
    a handler, and from the handler call SYS$UNWIND with no arguments.
    If you want your AST routine to return a value, modify the
    saved R0 and saved R1 in the mechanism vector.
    
    	KC
443.8WJG::GUINEAUFri Sep 18 1987 18:0610
    
>    I suspect you want to unwind the AST, and no further.   This is
>    the normal case.   To do that, have your AST routine enable
>    a handler, and from the handler call SYS$UNWIND with no arguments.
>>    If you want your AST routine to return a value, modify the
>>    saved R0 and saved R1 in the mechanism vector.

Who would get the AST's value?


443.9fyiSQM::RICOTue Sep 22 1987 13:196
    Re .7

    I believe that using LIB$SIG_TO_RET is the equivalent of doing
    a $UNWIND with no arguments and placing a value in the saved R0.

            Rico