Sponsored Content
Full Discussion: posix ipc message queue
Operating Systems HP-UX posix ipc message queue Post 302072105 by cadanir on Thursday 27th of April 2006 12:46:13 PM
Old 04-27-2006
pipcs -qa gives me somthing like this :

POSIX IPC status as of Thu Apr 27 15:59:08 2006
T MODE OWNER GROUP REFCNT QNUM MNUM QBYTES NAME
POSIX Message Queues:
q rw-rw---- abmd AZZX 1 0 100000 22 /abLVxy
q rw-rw---- abcd ABZY 13 0 50000 256 /abgxy
q rw-rw---- abcd ABZY 3 0 1000 256 /abILxy
q rw-rw---- abcd ABZY 1 0 50000 256 /ab0xy
q rw-rw---- abcd ABZY 1 0 50000 256 /abMD1xy
... etc
q rw-rw---- acc4d AZZX 0 0 1024 256 /abSOxy
q rw-rw---- acc4d AZZX 0 901 1024 256 /ab0Axy
q rw-rw---- acc4d AZZX 0 4 1024 256 /ab10xy
q rw-rw---- abcd ABZY 0 0 100000 14 /abB1xy
q rw-rw---- u91134 ABZY 0 0 100 10 /aby
q rw-rw---- acc4d AZZX 0 5 1024 256 /abITxy
q rw-rw---- abcd ABZY 2 0 100000 14 /abW1xy

And if I try to create a new one, with msg size 32 and queue length 128 :

mqopen 128 32 -c /test_32x128

There is no pb.

...but if I use :

mqopen 1024 10000 -c /test (this also is ok)
mqopen 1024 10000 -c /test2 (this fails ...)
mq_open(): No space left on device

It's ok, if I reduce the number of messages on the queue :
mq_open -b 1024 -m 5000 -c /test2 (this works)

The pb is that we have 12 Go of physical RAM available...

This link http://docs.hp.com/en/32650-90879/ch03s03.html says :
"
MESSAGE [ENOSPC] No space left on device. (POSIX.1 ERROR 28)

CAUSE During a write() function on a regular file, or when extending a directory, there was no free space left on the device.

ACTION Deallocate unneeded disk space.
"

Here the error occurs when we try to create a new queue not when we try to write a message on a queue.

Under Linux kernel 2.6 and probably under FreeBSD 7, posix queues use a "virtual file system" to make permanent the content of the queue between reboot and use shared memory. This is something like a filesystem in memory... in turn shared memory is implemented using ipc sys v shared memory system calls : shmat(), etc ...We already allow max usage os shared mem with kernel params. I try to know what is limiting us now ? Max adressable space for shared mem is 1.75 GB under HP-UX, but we cannot create any queue after that all existing queues use approx. 900 MB...

Of course there is a lot of apps running and sharing the same space of 1.75 GB. vmstat says we still have 407000 free page (if a page is 4096 Bytes), this gives 450 MB available. Of course I don't know if this RAM is contiguous or fragmented... this perhaps explain why we fail with a queue of 10 MB and not 5MB... I don't know if there is a way to unfragment memory without rebooting...

It's very strange that on a system with 12GB RAM, HP-UX fixed the shared memory adress range from 0x8000 0000 to 0xefff ffff... Is this the way they understand virtual memory ? Or perhaps I misunderstand their man pages...

Thank you again for your interest on this problem,
Cengiz ADANIR.
 

10 More Discussions You Might Find Interesting

1. Programming

POSIX Message Queue - Settings

How can I increase the POSIX Msg Q parameter SC_MQ_PRIO_MAX? The maximum is defined as 32. Can I increase the number? If so, how? Deepa (0 Replies)
Discussion started by: Deepa
0 Replies

2. UNIX for Dummies Questions & Answers

Posix vs System V IPC quesions

What are the differences/similarities between posix and system V ipc and their mechanisms? also, why is system v only limited to inter-process communication on a single node? thanks (0 Replies)
Discussion started by: jsimpson
0 Replies

3. Linux

POSIX message queue size

Hi all, Please tell me how to change POSIX message queue maximum size? "ulimit" is not a solution because it controls shell resources. But i need to control queue size before login in and starting the shell. It is needed to limit queue size for applications started before login in. Sorry for my... (7 Replies)
Discussion started by: Vourhey
7 Replies

4. Programming

How to limit max no of message in a posix message queue

Hii can anyone pls tell how to limit the max no of message in a posix message queue. I have made changes in proc/sys/fs/mqueue/msg_max But still whenever i try to read the value of max. message in the queue using attr.mq_curmsgs (where struct mq_attr attr) its giving the default value as 10.... (0 Replies)
Discussion started by: mohit3884
0 Replies

5. Programming

IPC - queue problems

Hi, I´m having a lot of problems when working with message queues, both on HP-UX Systems and Sun Solaris. When we fill a queue with a messages, the system hangs and locks everything that relies on the use of IPC resources. Anyone knows how to eliminate this problem? Thanks, Haroldo Teixeira (2 Replies)
Discussion started by: haroldo
2 Replies

6. UNIX for Dummies Questions & Answers

IPC Message Queue. msgrcv doesnt work..

Hi everybody, this is the situation. there is a programm XYZ which opens a message queue with the key 47110815 and waits for a SIGUSR1. After receiving this signal it sends a message with type 100 and a number (as ASCII) in the message-body. I have to write a prog which frist sends the... (1 Reply)
Discussion started by: daredevil82m
1 Replies

7. Programming

kill() function problem in client-server ipc message using 2 FIFOs

I want to have a message send & receive through 2 uni-direction FIFO Flow of data FIFO1 stdin--->parent(client) writefd--->FIFO1-->child(server) readfd FIFO2 child(server) writefd2---->FIFO2--->parent(client) readfd2--->stdout I need to have boundary structed message... (3 Replies)
Discussion started by: ouou
3 Replies

8. Programming

Please help:program hang stuck there signal handling on POSIX Message Queue UNIX C programming

in a single main() function,so need signal handling. Use Posix Message Queue IPC mechanism , can ignore the priority and other linked list message,to implement the scenario: client:Knock Knock server:who's there client: Eric Server:Eric,Welcome. client:exit all process terminated ... (1 Reply)
Discussion started by: ouou
1 Replies

9. Programming

POSIX Message Queue Memory Allocation

Hi, I wanted to know whether the POSIX message queues are statically allocated memory by the kernel based on the parameters specified in the open or as and when we send messages, memory are allocated? Does the kernel reserve the specified memory for the message queue irrespective of whether... (1 Reply)
Discussion started by: sumtata
1 Replies

10. Programming

POSIX message queue mq_open directory

hello, I try to test the POSIX mq_open function on book unp like below: #include "unpipc.h" # include <mqueue.h> int main(int argc, char **argv) { int c, flags; mqd_t mqd; flags = O_RDWR | O_CREAT; while ((c = getopt(argc, argv, "e")) != -1) { ... (3 Replies)
Discussion started by: anpufeng
3 Replies
MSGGET(2)						      BSD System Calls Manual							 MSGGET(2)

NAME
msgget -- get message queue LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sys/types.h> #include <sys/ipc.h> #include <sys/msg.h> int msgget(key_t key, int msgflg); DESCRIPTION
The msgget() function returns the message queue identifier associated with key. A message queue identifier is a unique integer greater than zero. A message queue is created if either key is equal to IPC_PRIVATE, or key does not have a message queue identifier associated with it, and the IPC_CREAT bit is set in msgflg. If a new message queue is created, the data structure associated with it (the msqid_ds structure, see msgctl(2)) is initialized as follows: o msg_perm.cuid and msg_perm.uid are set to the effective uid of the calling process. o msg_perm.gid and msg_perm.cgid are set to the effective gid of the calling process. o msg_perm.mode is set to the lower 9 bits of msgflg. o msg_cbytes, msg_qnum, msg_lspid, msg_lrpid, msg_rtime, and msg_stime are set to 0. o msg_qbytes is set to the system wide maximum value for the number of bytes in a queue (MSGMNB). o msg_ctime is set to the current time. RETURN VALUES
Upon successful completion a positive message queue identifier is returned. Otherwise, -1 is returned and the global variable errno is set to indicate the error. ERRORS
[EACCES] A message queue is already associated with key and the caller has no permission to access it. [EEXIST] Both IPC_CREAT and IPC_EXCL are set in msgflg, and a message queue is already associated with key. [ENOSPC] A new message queue could not be created because the system limit for the number of message queues has been reached. [ENOENT] IPC_CREAT was not set in msgflg and no message queue associated with key was found. SEE ALSO
msgctl(2), msgrcv(2), msgsnd(2) HISTORY
Message queues appeared in the first release of AT&T System V UNIX. BSD
July 9, 2009 BSD
All times are GMT -4. The time now is 01:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy