[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

636.0. "MAILBOX help please." by BMT::MISRAHI (at the tone, please leave your ...) Fri Dec 18 1987 20:56

    MAILBOX questions....
    
    We want to use MAILBOXES 'cause they will give a better performance
over using an RMS file, in this application.
    
    If I create my mailbox and at login time have each of the 10
    processes (users) call SYS$CREMBX to assign a channel number
    I can then call my QIO.
    But later on the same user will want to do another QIO, but needs
    to remember the channel #. Is it expensive in performance terms
    to perform a CREMBX for each QIO ?
    Or, can I somehow save the channel #. Assigning it to a logical
    and xlating the logical is an option but this is not terribly
    effiecient ( I need FAST responses). ( However, CREMBX must be doing
    this anyway).
    Another option is put the channel number after the first time I
    call CREMBX in a global section, somehow, but then I'm not sure
    how to access it afterwards.
   
T.RTitleUserPersonal
Name
DateLines
636.1Well..MDVAX3::COARMy hero? Vax Headroom, of course!Sat Dec 19 1987 22:1826
636.2just use $CREMBXAITG::MACKINJim MackinSat Dec 19 1987 23:2412
    Of course, if you are in fact doing an image activation/deactivation
    in between steps, then it really doesn't make much of a difference,
    you'll spend much more time getting into the image than either opening
    a file, calling $CREMBX, or calling $TRNLNM.  
    
    BTW: If you are running a new image, then calling $CREMBX is usually
    what's done to get the channel number of the mailbox.  If you are
    doing this completely in DCL (except for the $CREMBX at login time),
    then what you probably want to do after running the program that
    does the $CREMBX is to do a DCL OPEN command -- the channel id will
    remain in the logical you specify and DCL WRITE's and READ's will
    do the trick.
636.3PSW::WINALSKIPaul S. WinalskiSun Dec 20 1987 19:4317
RE: .2

>    If you are
>    doing this completely in DCL (except for the $CREMBX at login time),
>    then what you probably want to do after running the program that
>    does the $CREMBX is to do a DCL OPEN command -- the channel id will
>    remain in the logical you specify and DCL WRITE's and READ's will
>    do the trick.

Unfortunately, this won't work.  The $CREMBX results in a channel that's
assigned in user mode.  It gets run down along with all other user mode stuff
when the program exits.  Unless somebody else has a channel assigned to the
mailbox, the mailbox itself will go away when the channel does at image
exit.  The logical name with the device name (NOT the channel number, mind you)
goes away as well.  The DCL OPEN will fail.

--PSW
636.4PSW::WINALSKIPaul S. WinalskiSun Dec 20 1987 19:4712
RE: .0

You can't remember the channel number, anyway--the channel is deassigned when
the program that did the $CREMBX exits.  $CREMBX does give you the option of
having it create a logical name that translates to the mailbox's device name.
You can use this logical name in subsequent $ASSIGN statements to get new
I/O channels--you don't have to do another $CREMBX.  $ASSIGN is fast.

You mention global sections.  If speed is really important here, why not pass
the messages in a global section and avoid doing $QIO entirely?

--PSW
636.5Good idea!MDVAX3::COARMy hero? Vax Headroom, of course!Mon Dec 21 1987 15:0411
    You can remember the channel number if it wasn't assigned in user
    mode.  It's not that the mailbox channel is deassigned when the
    image exits, it's that *all* USER-mode activities (logical names,
    channels, exit handlers, and so forth) are run down when the image
    is.
    
    The point about using $ASSIGN is good - if the $ASSIGN call fails,
    the mailbox isn't around, so turn it into a $CREMBX and re-issue
    it.
    
    #ken	:-)}