Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between message queues and mailboxes

In operating system what is the difference between message queues and mailboxes.

like image 280
Ginu Jacob Avatar asked Oct 27 '15 15:10

Ginu Jacob


People also ask

What is mailbox and message queue?

In computer science, message queues and mailboxes are software-engineering components typically used for inter-process communication (IPC), or for inter-thread communication within the same process. They use a queue for messaging – the passing of control or of content.

What is the difference between message queue and shared memory?

Message queue has inherent synchronization overhead, guarantee of safety at cost of performance. Shared memory has no safeguards - if two threads access it simultaneously, they will possibly conflict (write inconsistent data) unless you assure thread safety yourself.

What is the difference between message queue and pipes?

The pipe is the Unix IPC form to provide a flow of information in one direction. Message Queue is a System VIPC form to store a list of messages. A pipe can be created using pipe() function which returns two file descriptors, one is for reading and another is for writing.

What is the difference between a message queue and a task queue?

A Message Queue is a mechanism for sharing information, between processes, threads, systems. An AppEngine task Queue is a way for an AppEngine application to say to itself, I need to do this, but I am going to do it later, outside of the context of a client request.


1 Answers

I suspect there is no universally accepted definition for what makes a message queue versus a mailbox. Each RTOS may use different terminology and implementation details so you'd have to look at each RTOS individually.

Generally speaking some of the common differences include:

  • Is the size of the messages sent through the queue/mailbox fixed or can the message size vary?
  • Does the queue/mailbox hold a reference to the message or a copy of the message?
  • Can the queue/mailbox hold one message, multiple messages, or unlimited messages?
like image 138
kkrambo Avatar answered Sep 29 '22 06:09

kkrambo