Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-28-2012, 04:31 AM   #1
LQ Newbie
Registered: Jan 2012
Posts: 1

Rep: Reputation: Disabled
what is the main difference b/w message queue and pipe.

what is the main difference b/w message queue and pipe.

abstractly both does the same work.
Old 01-28-2012, 05:03 AM   #2
Satyaveer Arya
Senior Member
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,415

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
If you would have googled your question, definitely you get the answer. Anyways this is what I googled and found your answer:

Message Queues are:

2. Fixed number of entries
3. Each entry has a maximum size
4. All the queue memory (# entries * entry size) allocated at creation
5. Datagram-like behavior: reading an entry removes it from the queue. If you don't read the entire data, the rest is lost. For example: send a 20 byte message, but the receiver reads 10 bytes. The remaining 10 bytes are lost.
6. Task can only send on a single queue using msqQReceive (there are ways to change that with alternative API)
7. When sending, you will send if the queue is full (and you don't do NO_WAIT)
8. When receiving, you will send if the queue is empty (and you don't do NO_WAIT)
9. Timeouts are supported on receive and send


1. Are a layer over message Queues <--- Unidirectional!
2. Have a maximum number of elements and each element has maximum size
is NOT A STREAMING INTERFACE. Datagram semantics, just list message Queues
3. On read, WILL SEND until there is data to read
4. On write, WILL SEND until there is space in the underlying message queue
5. Can use select facility to wait on multiple pipes

Last edited by Satyaveer Arya; 01-28-2012 at 05:20 AM.
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
difference between ready queue and run queue soumya_r Linux - Kernel 2 01-11-2011 10:19 PM
Is it possible for me to write in front of queue in case of message queue? hemanthv414 Linux - Newbie 1 11-17-2008 05:40 PM
Message Queue sarcastodon Programming 0 12-26-2006 11:09 AM
Qmail Message Queue dadepfan Linux - Software 0 07-22-2004 04:54 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:43 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration