Mailbox synchronisation or communication mechanism?

Q1) Is mailbox used for synchronisation or as a communication channel (FIFO ordered) between processes?

It is a built-in class like any other class but, has built-in methods that operate on FIFO ordered queue, to perform desired operations.

Q2) Mailbox methods are built-in std package described as Put (), Get (), Peek () as tasks and others new (), num () try_put (), try_get () and try_peek as functions. Do these methods provide synchronisation? If yes, how? or perform control over mailbox communication channel? How?

Q3) What if we write our own methods in a package and try implement queue instead of mailbox? Is it possible? If yes, how?

In reply to Viral Doshi 2013:

This seems like an interview question. See if reading this helps:
queue and mailbox | Verification Academy

In reply to dave_59:
Thank you, Dave Rich.

I have read through your provided link, it has help me but not entirely. I’m a bit puzzled about how semaphores are used to access control ends of queues in mailbox. An answer in your link reads, when multiple threads want to write and read data, mailbox uses atomic test-and-set operation of semaphore which I’m not sure, how?. If you could give a brief idea about atomic test-and-set operation of semaphore. It should convince me to believe that mailbox is used for both synchronisation and as a communication channel between processes.

In reply to Viral Doshi 2013:

http://courses.teresco.org/cs432_f02/lectures/07-synch/07-synch.html