Message Passing and Locks
Message passing can be used as a way of controlling access to resources in a concurrent or asynchronous system. One of the main alternatives is mutual exclusion or locking. Examples of resources include shared memory, a disk file or region thereof, a database table or set of rows.
In locking, a resource is essentially shared, and processes wishing to access it (or a sector of it) must first obtain a lock. Once the lock is acquired, other processes are blocked out, ensuring that corruption from simultaneous writes does not occur. After the process with the lock is finished with the resource, the lock is then released.
With the message-passing solution, it is assumed that the resource is not exposed, and all changes to it are made by an associated process, so that the resource is encapsulated. Processes wishing to access the resource send a request message to the handler. If the resource (or subsection) is available, the handler makes the requested change as an atomic event, that is conflicting requests are not acted on until the first request has been completed. If the resource is not available, the request is generally queued. The sending programme may or may not wait until the request has been completed.
Read more about this topic: Message Passing
Famous quotes containing the words message, passing and/or locks:
“All this is from God, who reconciled us to himself through Christ, and has given us the ministry of reconciliation; that is, in Christ God was reconciling the world to himself, not counting their trespasses against them, and entrusting the message of reconciliation to us.”
—Bible: New Testament, 2 Corinthians 5:18-19.
“The statue is then beautiful when it begins to be incomprehensible, when it is passing out of criticism, and can no longer be defined by compass and measuring-wand, but demands an active imagination to go with it, and to say what it is in the act of doing.”
—Ralph Waldo Emerson (18031882)
“Hes made a harp of her breast-bane,
Whose sound wad melt a heart of stane.
Hes taen three locks o her yellow hair,
And wi them strung his harp sae rare.”
—Unknown. Binnorie; or, The Two Sisters (l. 4144)