Deleting a message from a message queue??

Deleting a message from a message queue??

Post by James Knowle » Fri, 28 Jul 1995 04:00:00





   Newsgroups: comp.unix.programmer
   Date: 27 Jul 1995 04:44:56 GMT
   Organization: InterAccess, Chicago's best Internet Service Provider

   I have put together some code that let's several processes send messages
   to each other and after doing some reading I couldn't find any info on
   deleting a specific message from a queue.  The only thing I found was
   that with 'msgctl()' if you specify IPC_RMID it will remove the entire
   queue.

   Is there a way to remove a message from a queue?

   --

   John E. Joseph

--------------------------

     I believe that reading the message does that.
     (like in other queues)
     At least I have assumed that without untoward harm.
     If I'm wrong, somebody stop me.

------only MY opinion, and only my OPINION--------------------

 
 
 

Deleting a message from a message queue??

Post by John E. Josep » Fri, 28 Jul 1995 04:00:00


I have put together some code that let's several processes send messages
to each other and after doing some reading I couldn't find any info on
deleting a specific message from a queue.  The only thing I found was
that with 'msgctl()' if you specify IPC_RMID it will remove the entire
queue.

Is there a way to remove a message from a queue?

--

John E. Joseph

 
 
 

Deleting a message from a message queue??

Post by Dave Haverka » Sat, 29 Jul 1995 04:00:00



|> :
|> :
|> :I have put together some code that let's several processes send messages
|> :to each other and after doing some reading I couldn't find any info on
|> :deleting a specific message from a queue.  The only thing I found was
|> :that with 'msgctl()' if you specify IPC_RMID it will remove the entire
|> :queue.
|> :
|> :Is there a way to remove a message from a queue?
|> :
|>
|> the processes that read the queue will delete the message.  It is the
|> responsiblilty of the process to deal with the message at that point.  I
|> have got the reverse problem.  I am trying to have process read from the
|> queue without deleting the message.  Any suggestions ?

Reading messages from a queue deletes it's representation on the
queue... I haven't seen anything different unless Posix.4 has an
option to leave the message on the queue.

Read the message from the Queue, then write it back immediately.
That way your program has it, and it is back in the Q. (Last position)
You could probably work out a scheme using different message types to
read a message that has been previously read.

Dave

--
David Haverkamp

 
 
 

Deleting a message from a message queue??

Post by bill baldw » Sat, 29 Jul 1995 04:00:00



:
:
:I have put together some code that let's several processes send messages
:to each other and after doing some reading I couldn't find any info on
:deleting a specific message from a queue.  The only thing I found was
:that with 'msgctl()' if you specify IPC_RMID it will remove the entire
:queue.
:
:Is there a way to remove a message from a queue?
:

the processes that read the queue will delete the message.  It is the
responsiblilty of the process to deal with the message at that point.  I
have got the reverse problem.  I am trying to have process read from the
queue without deleting the message.  Any suggestions ?

 
 
 

Deleting a message from a message queue??

Post by James Burt » Tue, 08 Aug 1995 04:00:00




: |> :
: |> :
: |> :I have put together some code that let's several processes send messages
: |> :to each other and after doing some reading I couldn't find any info on
: |> :deleting a specific message from a queue.  The only thing I found was
: |> :that with 'msgctl()' if you specify IPC_RMID it will remove the entire
: |> :queue.
: |> :
: |> :Is there a way to remove a message from a queue?

I would think that would depend on what you were actually using
and how you were using it. As others have said you can always
remove the tail of the queue by reading it. If you want to remove
non-tail messages you might be able to give them a different
priority or something.

My question is what do people use to implement message queues
(mailboxes, whatever you want to call them) on BSD systems.
I understand that msgctl() is a SYSV-only feature.

I am trying to use a UNIX domain socket - it seems to work
but I have not been able to convince myself that writes
from multiple sources are guaranteed to be atomic. There
must be some experts out there.

I am using NetBSD with Perl currently.

Thanks,
James
--
James Burton                                    |

WWW  : http://Snark.apana.org.au/james/         | Melbourne, Australia

 
 
 

1. Error Message of Message Queue

  Dear netters,

  I have one question about message queue. Could anyone please do me a favor?

  I used UNIX message queue for interprocess communication. When I used  msgsnd
  function and IPC_NOWAIT argument, I will always get a error message:
  No more processes

  What does that mean? How does that happen?

  E-mail or post will be fine. Thanks in advance.

  Jeff Chen.

2. Help: Apache 1.1.1 server performance.

3. Message queue deleted

4. RedHat is slow

5. HELP! encoding messages for message queues

6. Linux Advocacy or M$ Bashing?

7. HELP!: encoding messages for message queues

8. DMA question

9. deleting all message queues at one time

10. HELP! encoding messages for message queues

11. How to delete messages from mail queue?

12. how to see messages in message queue ...

13. My stream socket vs message queue test results...