[Info-vax] QIO Writes to a mailbox

Steve Bainbridge stephen_bainbridge at yahoo.co.uk
Fri Nov 4 07:10:01 EDT 2011


> What would be helpful here is more info.  In the general sense, the
> procedures described should work.  However, there are too many
> questions about how the code is written. It is easy to write code at
> this level that will appear to work properly, yet be incorrect.
> Please provide environment information (hardware, software versions,
> programming language etc.) and perhaps a snippet of the code involved.
>
> Thanks,
> Dan
>
> DansABRservices @ yahoo . com
>
> For proper disclosure, many of us here provide consulting services to
> assist with problems such as these. Feel free to contact any of us
> directly for further assistance as quite often, problems such as these
> require hands on examination.

Dan,

This is on Alpha 4xCPU ES45 running OpenVMS 7.3-2 with the
applications primarily written in C and Pascal. The fact that it seems
to work 99.999% of the time suggest to me some sort of timing issue -
hence I'm keen to find out exactly when the supplied buffer is copied
by the QIO.

A chunk of code is below, first is the routine for
f_osi_write_to_mailbox and below that is the actual call to
f_osi_write_to_mailbox - this is the code in question. I'm not seeing
the error message "<MBXFWDERR>" in the logs so I'm assuming the QIO
was queued OK

Regards,
Steve

====================================================================================

struct ts_return_status f_osi_write_to_mailbox
(INTEGER                vp_qio_or_qiow,
                             UNSIGNED               vp_event_flag,
                             t_channel              vp_channel,
                             UNSIGNED               vp_function_code,
                             struct ts_iosb *       vp_iosb,
                             FUNCTION               (const
vp_ast_address),
                             UNSIGNED               vp_ast_parameter,
                             const ADDRESS          vp_buffer_address,
                             UNSIGNED               vp_buffer_size

{ /* f_osi_write_to_mailbox */
    struct ts_return_status vl_status;    /* return status from
function */

    if (vp_qio_or_qiow == C_OSI_NOWAIT)
    vl_status.s_system = sys$qio  (vp_event_flag,               /*
event flag number    */
                       (unsigned short) vp_channel,             /*
channel number       */
                       (unsigned short) vp_function_code,       /*
function code        */
                       vp_iosb,                                 /* I/O
status block     */
                       vp_ast_address,                          /* AST
service routine  */
                       (unsigned long)  vp_ast_parameter,       /* AST
parameter        */
                       (unsigned long)  vp_buffer_address,      /* P1
- Dependant       */
                       (unsigned long)  vp_buffer_size,         /* P2
-    Upon     */
                       0,                                       /* P3
- Function    */
                       0,                                       /* P4
-   Codes     */
                       0,                                       /*
P5           */
                       0);                                      /*
P6           */
    else
    vl_status.s_system = sys$qiow (vp_event_flag,               /*
event flag number    */
                       (unsigned short) vp_channel,             /*
channel number       */
                       (unsigned short) vp_function_code,       /*
function code        */
                       vp_iosb,                                 /* I/O
status block     */
                       vp_ast_address,                          /* AST
service routine  */
                       (unsigned long)  vp_ast_parameter,       /* AST
parameter        */
                       (unsigned long)  vp_buffer_address,      /* P1
- Dependant       */
                       (unsigned long)  vp_buffer_size,         /* P2
-    Upon     */
                       0,                                       /* P3
- Function        */
                       0,                                       /* P4
-   Codes     */
                       0,                                       /*
P5           */
                       0);                                      /*
P6           */

    vl_status.s_local = vl_status.s_system;
    return (vl_status);

} /* f_osi_write_to_mailbox */


====================================================================================


    /* Forward unknown message type to the specified destination
process */
    vl_osi_status = f_osi_write_to_mailbox (C_OSI_NOWAIT,
                        C_FORWARD_MBX_MSG_EF,
                        vl_mbx_channel,
                        C_OSI_WRITEVBLK,
                        &vl_iosb,
                        0,
                        0,
                        (CHAR *) vp_mbx_buffer,
                        vp_mbx_buffer->s_header.s_msg_size );


    if ( vl_osi_status.s_local != C_OSI_NORMAL )
    {
	    sprintf ( vl_signal_message,
			"<MBXFWDERR> Error sending/forwarding mailbox message %d from
process %s to process %s.",
			vp_mbx_buffer->s_header.s_msg_type,
			vl_source_process,
			vl_destination_process );

	...

    }

====================================================================================




More information about the Info-vax mailing list