Unix message Queue | Unix Linux Forums | UNIX for Advanced & Expert Users

  Go Back    


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

Unix message Queue

UNIX for Advanced & Expert Users


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 07-27-2003
kel kel is offline
Registered User
 
Join Date: Jul 2003
Last Activity: 7 August 2003, 1:00 AM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question Unix message Queue

Hi,
I am working closly with unix message queues i have encountered the following -
after creating the Q and start working with it (pushing & pulling) i receive the following stange parameters on the q's -
STIME=no_entry
Qnum=0
CBYTES=4140

when this happens, the Q is disabled (meaning i can not approach it by any way)

can anyone help ?

Thanks In Advanced
Kel

P.s
The same phonomenen is created on all the Q's i am working with.
Sponsored Links
    #2  
Old 07-29-2003
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 28 October 2014, 3:35 PM EDT
Location: Ashburn, Virginia
Posts: 9,930
Thanks: 64
Thanked 437 Times in 261 Posts
I don't understand what you are attempting nor what error you think you might be experiencing.

Ironically, the only part of your post that I decipher are the parameters that you find strange.

Your message queue is 4140 bytes long, the number of messages on the queue is zero, and the time of the last message send is... well, you never have sent a message to this queue.

Why is that strange? What is pushing and pulling? Do you mean push/pop as with a stack? How do you think you can do that? What does disabled mean? How do you approach a queue?
Sponsored Links
    #3  
Old 07-30-2003
kel kel is offline
Registered User
 
Join Date: Jul 2003
Last Activity: 7 August 2003, 1:00 AM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Hi,
Thanks for your replay.

I'll try to be more clear -
1. i have created the Q as follow:
'o_qid = msgget(IPC_PRIVATE,IPC_CREAT|0777|IPC_EXCL|S_IRUSR|S_IWUSR);'

And worked with the Q as follow:
'msgsnd( qid, (void*)(&eventDataBuffer), MessageSize, 0) '
'qbytesread=msgrcv(qid, (void*)pMessage, max_msgsize, -MSGTYPE_MAX_APP_RANGE, 0)'

2. The Q has functioned OK for about an hour, where data was surely sent & received.

3. On a certain point, i could not send, nor receive from the Q.
The parameters on the Q where:
Qnum=0 (The number of messages currently outstanding on the
associated message queue.)
CBYTES= ~4k (The number of bytes in messages currently outstanding on the associated message queue.)

This is what i do not understand. How come there are no messages, and the Q inform me that the data size is greater than 0?

I hope i made more clear.
Thanks Again.
    #4  
Old 07-30-2003
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 28 October 2014, 3:35 PM EDT
Location: Ashburn, Virginia
Posts: 9,930
Thanks: 64
Thanked 437 Times in 261 Posts
Hmmm....you do have a point. I was getting CBYTES mixed up with QBYTES.

I agree, for the most part, QNUM = 0 and CBYTES != 0 is not consistent. But I can think of one exception where it might make sense. When you do your msgsnd, you are setting msgflg to zero. That means that IPC_NOWAIT is turned off. The msgsnd system call checks to see if this message would exceed some limits. This includes a check of the message queue you are using as well as some system wide limits. If a msgsnd would exceed a limit and it did not set IPC_NOWAIT, the msgsnd system call will suspend until it is safe to send the message. I don't know what state the message queue is in during this suspension. It could well be that CBYTES has been increased but QNUM has not yet been incremented.

This would explain why it works for a few hours and then locks up. Reproduce the error and then run "ipcs -qa" and compare the total messages queue resources in use against your kernel parameters. If this is the problem, you will need to increase the kernel parameters. Or you may have a message queue leak somewhere.

That is my only idea. If it's not that, I would next suspect a broken kernel. You might check for any appropiate patches.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Please help:program hang stuck there signal handling on POSIX Message Queue UNIX C programming ouou Programming 1 06-15-2011 12:45 AM
Move xml files from unix to message queue. krishnan_6015@y Shell Programming and Scripting 0 03-23-2009 09:34 AM
UNIX Message Queue qlyine Programming 2 12-21-2008 04:55 AM
How to limit max no of message in a posix message queue mohit3884 Programming 0 06-10-2008 05:03 AM
message queue etenv Programming 2 11-02-2007 05:09 AM



All times are GMT -4. The time now is 07:21 AM.