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
IPC(2)							     Linux Programmer's Manual							    IPC(2)

NAME
ipc - System V IPC system calls SYNOPSIS
int ipc(unsigned int call, int first, int second, int third, void *ptr, long fifth); DESCRIPTION
ipc() is a common kernel entry point for the System V IPC calls for messages, semaphores, and shared memory. call determines which IPC function to invoke; the other arguments are passed through to the appropriate call. User programs should call the appropriate functions by their usual names. Only standard library implementors and kernel hackers need to know about ipc(). CONFORMING TO
ipc() is Linux-specific, and should not be used in programs intended to be portable. NOTES
On a few architectures, for example ia64, there is no ipc() system call; instead msgctl(2), semctl(2), shmctl(2), and so on really are implemented as separate system calls. SEE ALSO
msgctl(2), msgget(2), msgrcv(2), msgsnd(2), semctl(2), semget(2), semop(2), semtimedop(2), shmat(2), shmctl(2), shmdt(2), shmget(2) COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2007-06-28 IPC(2)
All times are GMT -4. The time now is 12:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy