Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 9

OPERATING SYSTEMS

(18EC641)
MAILBOXES

SHAIK ARIF NAJEEB


1VI19EC132
MAILBOXES

• Mailbox is a REPOSITORY for inter process messages.


• It has a unique Identity.
• The owner of the mailbox is typically the process that created it, only the
owner process can receive messages from a mailbox.
• Any process that knows the Identity of a mailbox can send a message to it.
MAILBOXES
MAILBOXES

• Process Pi create the mailbox using the call create_mailbox.


• Process Pj send a message to the mailbox using the mailbox name, instead of
process ID, in its send call. This is an instance of indirect naming
• A message sent to sample is controlled in a buffer. It is delivered to process Pi
when Pi performs a receive on sample.
• Some other processes for example Pk and PL might also send messages to
sample. Both create_mailbox and send call would retun with some status code
to indicate success or failure of the call.
MAILBOXES

• The kernel may associate a fixed set of buffers with each mailbox when a
message is sent.
• kernel may provide a fixed set of mailbox names.
• Alternatively , it may permit the uses processes to create names of their choice.
• In the former case confidentiality of communication between a pair of
processes cannot be guaranteed because any process can create or connect to
any mailbox.
• This problem becomes less severe when processes can assign mailbox names
of their own choice.
MAILBOXES

• Exercise control over creation and destruction of mailboxes the kernel may
require process to explicit connect to a mailbox before starting to use it and to
disconnect after finishing its use.
• This way it can destroy a mailbox to which no process is connected.
• The kernel mein permit the owner of the mailbox destroy it, in that case the
kernel has to notify destruction of the mailbox to all the users who have
connected to it.
• So that the kernel may permit the ownership of the mailbox to be transferred to
another process
MAILBOXES

Advantages of mailboxs:
• Anonymity of receiver: A process sending a message to a mailbox need not
know identity of the receiver process. A process can take over the functionality
of another process.
• Classification of message: A process may create several mailboxes, and use
each mailbox to receive messages of specific kind. This arrangement permits
easy classification of messages.
MAILBOXES

• Anonymity of receiver process can be used to transfer function from one


process to another
• Interrupts 11 to the causes scheduling function can be modelled as messages
sent to mailbox named scheduleing.
• Functionalities of OS serves can be similarly transferred.
• Although process can send a message to a mailbox anonymously if is often
necessary
THANK YOU 😊

You might also like