Message passing refers to the messages that information systems pass among themselves in a concurrent system, achieving thereby some kind of distributed computation. Message passing systems use some form of inter-process communication provided by the platform.
In message-passing systems, one system makes a request, and another provides a response. The requestor is called the client, and the responder is called theer server. These roles exists even in peer-to-peer systems, where the participants take on one role or the other for the duration of the conversation.
RS: A simple file signalling between two processes, that both have write access to the same directory (but could run on different boxes and OSes, like Unix and WinNT), can look like this:
proc fsignal {cmd name {msg {}}} { switch $cmd { send { set fp [open $name.sig w] if {[string length $msg]} {puts $fp $msg} close $fp } wait { while 1 { if {[file exists $name.sig]} { set fp [open $name.sig] set msg [read $fp] close $fp file delete $name.sig break } else {after 100} } } } set msg ;# return the message from sender in both cases } # process 1: (when conditions are ripe) fsignal send Go 42 # process 2: (before the real action) set Magic [fsignal wait Go]
See also filewait for a related scriptlet.