2. • Mach is object-oriented system.
• Data and the operations that manipulate that data are
encapsulated into an abstract object..
• The details of how these operations are implemented are
hidden, as are the internal data structures.
• Use of an object is done by invoking its defined
• It allows objects to reside anywhere in a network of Mach
systems, transparent to the user.
4/9/2013 arifch2009@gmail.com
4. • Task : A task is an execution environment , a traditional
process would be implemented as a task with a single thread
of control.
– May have multiple thread.
– Resources : Address Spaces, Threads, Port rights, ports sets, local
name spaces.
– task_create(parent_task, inherit_memory, child_task)
• Thread : is the basic unit of execution and must run in the
context of a task (which provides the address space).
– All threads within a task share the tasks’ resources (ports, memory,
and so on).
– The threads belonging to a single task can execute in parallel at
different processors in a shared-memory multiprocessor.
– thread_create(parent_task, child_thread)
– thread_set_state(thread, flavour, new_state, count)
– Thread_resume(thread)
4/9/2013 arifch2009@gmail.com
5. • Port : is a unicast, unidirectional communication channel
with an associated message queue.
– a task must have a port right to send a message to a port.
– Communication is accomplished by sending messages to ports.
– messages are queued at the destination port if no thread is
immediately ready to receive them.
• Port Set : Set of ports treated as a single unit when
receiving a message.
– They share a common message queue.
– Each received message identifies the individual port
4/9/2013 arifch2009@gmail.com
6. • Messages : is the basic method of communication
between threads in Mach.
– Contain Message header.
– It is a typed collection of data objects.
– Port rights are passed in messages;
• Memory object : is a source of memory; tasks can
access it by mapping portions of an object (or the entire
object) into their address spaces.
4/9/2013 arifch2009@gmail.com
7. Communication Model
• Ports are the channel where communication occurs by
sending message to ports.
• Mach provides a single system call for message passing:
mach_msg
mach_msg(msg_header, option, snd_siz, rcv_siz, rcv_name,
timeout, notify)
4/9/2013 arifch2009@gmail.com
8. • The header is composed of:
– Port destination.
– Answer port.
– Operation identifier.
– Size of the data list.
4/9/2013 arifch2009@gmail.com
In a request/response messaging pattern, one party sends a request message and the receiving party returns a response message. Two typical examples of request/response processing are the interaction that a browser has with a Web server using the HTTP adapter, and Web service processing using the Simple Object Access Protocol (SOAP) adapter