theoretical limit on message queue sizes
Hi All,
Following function obtains the system-maintained structure for a message queue:
Code:
bool getMessageQueueStats(int mqId, struct msqid_ds* buf)
{
if(msgctl(mqId, IPC_STAT, buf) == -1)
{
return false;
}
return true;
}
And following function simply resizes a message queue to a user-defined value, namely, "size":
Code:
bool resizeMessageQueue(int mqId, struct msqid_ds* buf, int size)
{
/* Modify the message queue features */
buf->msg_perm.uid = geteuid();
buf->msg_perm.gid = getegid();
buf->msg_perm.mode = 0660;
buf->msg_qbytes = size; // The new size for the message queue
if(msgctl(mqId, IPC_SET, buf) == -1)
{
return false;
}
return true;
}
My question is if there is a theoretical limit on user-defined message queue sizes.
To put in other words, is it possible to increase the default message queue size to any user-defined value as long as that certain value does not exceed the size of system's physical memory ?
By the way, I use 64-bit Ubuntu 9.04.
Thanks.
Re: theoretical limit on message queue sizes
You can change the default message queue size in Linux by changing /proc/sys/kernel/msgmnb.
Example:
Code:
echo "4294967295" >/proc/sys/kernel/msgmnb