The Mailbox package is built on three layers of portability. Each layer adds a certain degree of functionality and machine independence. The lowest and most device-dependent layer, MPTHD, implements the basic context switching required for any multitasking package; it provides threads of execution. The middle layer, MPTSK, implements scheduling and interprocess communication, non-preemptive multitasking based on MPTHD's; it provides independent, communicating tasks.5 The top layer, MPRES, implements basic resource management for all standard resources and those you may add, preemptive multitasking based on MPTSK's.
Since each layer depends only on the layer below it, you may incorporate only the layers necessary to suit your needs. The remainder of this section discusses each of them in detail.