Operating System - HP-UX
1753861 Members
7473 Online
108809 Solutions
New Discussion юеВ

Re: Sharing Data using Message Queues between 32 Bit and 64 Bit

 
Maverick_2
Occasional Advisor

Sharing Data using Message Queues between 32 Bit and 64 Bit

Hi

We are passing data using message queues between 32 Bit and 64 Bit Apps..

Our functions looks like this in 64 Bit
SendMsg(void * SendBuffer , long len , struc handle )
{
msgsnd(handle->msqid , sendBuffer , len , IPC_NOWAIT);
}

In 32 Bit it is recived as
RecMsg(void * RecvBuffer , long len , struc handle )
{
msgrcv(handle->msqid, RecvBuffer , len , ANY_MSG,MSG_NOERROR);
}

The messages are truncated when they are received in the 32 Bit app.

Any Help would be appreciated

Thanks in Advance..
4 REPLIES 4
A. Clay Stephenson
Acclaimed Contributor

Re: Sharing Data using Message Queues between 32 Bit and 64 Bit

Part of the problem may be that the two were compiled under different versions of the OS. Prior to 11.11, msg's were limited by the underlying 16-bit (unsigned) data structure at 64K. If the msg's are 64K and up then one workaround would be to set the msgmnb kernel tunable to 64K or less.

Plan B. I would compile a 32-bit bit program that does the initial msgget to create the message queue and then fork(), exec() the "real" 64-bit application.
If it ain't broke, I can fix that.
Maverick_2
Occasional Advisor

Re: Sharing Data using Message Queues between 32 Bit and 64 Bit

Thanks for the reply.
Well both the apps are compiled on HPUX11i.
Do we still need to modify the Kernel params.

Thanks..
A. Clay Stephenson
Acclaimed Contributor

Re: Sharing Data using Message Queues between 32 Bit and 64 Bit

If you are exceeding 64K messages then that would be my first cut at it. Man msgget for some other approaches but I would chgange the tunable and that would eliminate the 64K boundary as the source of the problem. If confirmed, you can again increase the tunable and try the other solutions suggested in the man pages.
If it ain't broke, I can fix that.
Maverick_2
Occasional Advisor

Re: Sharing Data using Message Queues between 32 Bit and 64 Bit

Thanks
The msgmnb kernel tunable is currently set to 32K . The messages we are passing from the 64Bit app to the 32 Bit app are pretty small. Does the 64 Bit app pads a lot of additional stuff which breaks the boundry limits.
Just wanted to ensure that changing the msgmnb kernel tunable would resolve the issue since it would require a reboot etc.

Thanks