473,322 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Count Messages in Message Queue

Hi,

I have developed an application in C on IBM AIX 5.2. Its using
multiple Message Queues to share data between different processes. I
am using following functions to send/receive messages into/from
message queues:

int msgget(key_t, int);
ssize_t msgrcv(int, void *, size_t, long int, int);
int msgsnd(int, const void *, size_t, int);

Now I want to calculate number of messages in each message queue at a
specific time. So which function should I use? There is a function
named "mq_getattr" to get queue attributes. Can this help out?

Thanks in anticipation.

Regards,

Ahmad Jalil Qarshi
Aug 10 '08 #1
3 4975
On Sun, 10 Aug 2008 16:27:50 -0700 (PDT), Ahmad Jalil Qarshi
<Ah****************@gmail.comwrote in comp.lang.c:
Hi,

I have developed an application in C on IBM AIX 5.2. Its using
multiple Message Queues to share data between different processes. I
am using following functions to send/receive messages into/from
message queues:

int msgget(key_t, int);
ssize_t msgrcv(int, void *, size_t, long int, int);
int msgsnd(int, const void *, size_t, int);

Now I want to calculate number of messages in each message queue at a
specific time. So which function should I use? There is a function
named "mq_getattr" to get queue attributes. Can this help out?

Thanks in anticipation.

Regards,

Ahmad Jalil Qarshi
Ahmed,

This is not really the correct place to ask this question. Your
question is not about the C language or standard C library, which are
the topics here. Instead your question is about the use of a
system-specific library, which is not part of the C language itself.

I see a large number of newsgroups dedicated to IBM's AIX, although I
do not know how active any of them are. For example:

news:comp.sys.aix, news:comp.unix.aix, and several in the family
news:ibm.*.aix.

The people most knowledgeable about AIX and the specific functions you
are trying to use will most likely be found in one of these groups.

I suggest you take a look at these groups, and select one or two to
ask this question.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
Aug 11 '08 #2
Jack Klein <ja*******@spamcop.netwrote:
On Sun, 10 Aug 2008 16:27:50 -0700 (PDT), Ahmad Jalil Qarshi
<Ah****************@gmail.comwrote in comp.lang.c:
I have developed an application in C on IBM AIX 5.2. Its using
multiple Message Queues to share data between different processes. I
am using following functions to send/receive messages into/from
message queues:

int msgget(key_t, int);
ssize_t msgrcv(int, void *, size_t, long int, int);
int msgsnd(int, const void *, size_t, int);

Now I want to calculate number of messages in each message queue at a
specific time. So which function should I use? There is a function
named "mq_getattr" to get queue attributes. Can this help out?
This is not really the correct place to ask this question. Your
question is not about the C language or standard C library, which are
the topics here. Instead your question is about the use of a
system-specific library, which is not part of the C language itself.
I see a large number of newsgroups dedicated to IBM's AIX, although I
do not know how active any of them are. For example:
news:comp.sys.aix, news:comp.unix.aix, and several in the family
news:ibm.*.aix.
Since the functions named by Ahmad are all POSIX functions and thus
probably not AIX-specific also e.g. comp.unix.programmer would be
a reasonable choice of a group for asking the question.

Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
Aug 11 '08 #3
On 10 Aug 2008 at 23:27, Ahmad Jalil Qarshi wrote:
I have developed an application in C on IBM AIX 5.2. Its using
multiple Message Queues to share data between different processes. I
am using following functions to send/receive messages into/from
message queues:

int msgget(key_t, int);
ssize_t msgrcv(int, void *, size_t, long int, int);
int msgsnd(int, const void *, size_t, int);

Now I want to calculate number of messages in each message queue at a
specific time. So which function should I use? There is a function
named "mq_getattr" to get queue attributes. Can this help out?
No, but there's a function called msgctl() that you can use for that.

int msgctl(int msqid, int cmd, struct msqid_ds *buf);

If you call this function with IPC_STAT as the cmd argument, this will
fill out the struct pointed to by buf with various bits of information
from the kernel struct associated to the message queue. Check the
documentation for your system to find out what this information consists
of, but in particular POSIX guarantees the existence of a buf->msg_qnum
field of type msgqnum_t, which contains the current number of messages
in the queue.

Aug 11 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Matthew Groch | last post by:
Hi all, I've got a server that handles a relatively high number of concurrent transactions (on the magnitude of 1000's per second). Client applications establish socket connections with the...
1
by: Reshma Prabhu | last post by:
Hello, Could any one please give me a sample code to count the number of messages in a queue using C# and the .NET environment without using Performance counters. Thanks, Reshma
3
by: Sun | last post by:
If the email server goes down, I won't be able to send messages using SmtpMail. I'll get a "Could not Access CDO.Message ..." error. Is there a way to queue the message so that it can be sent out...
2
by: Al Wilkerson | last post by:
Does anyone know why smtp messages stay in the queue folder? Every time I send a message using my local smtp server I get no error, but I never receive the message, and the messages just stay in...
0
by: Manfred Braun | last post by:
Hi All, I have a problem reading queue-messages async. My QueueReader has a Start() and a Stop() method and if my app starts, it calls Start(). The problem is, that there are possibly several...
2
by: SammyBar | last post by:
Hi all, I'm trying to send a message from ASP.NET to another PC by using MSMQ. I created my ASP.NET project by using Visual Studio 2005 but I initially set the project to be located on the File...
0
by: TweetyRocks | last post by:
Hi All, I have 2 Dot Net Windows services. The 1st service inserts a message into an MSMQ queue. The second service picks it up from the queue and processes it. It then removes it from the queue...
4
by: =?Utf-8?B?am9obmY=?= | last post by:
Trying to get a see windows messages using IMessageFilter interface however it does not seem to get all window messages. Specifically I am looking for the WM_POWERBROADCAST. I override wndproc...
3
by: scriptlearner | last post by:
I am trying to put up a queue (through a logging thread) so that all worker threads can ask it to log messages. However, the problem I am facing is that, well, the logging thread itself is running...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.