resource chicken import fox op peep(a : int; b : real; c : char) op cluck(d : string[*]) body chicken(foxy : cap fox) var x : int var y : real var z : char var s : string[64] write("chicken is alive") process chick receive peep(x, y, z) write("chicken receive peep, x=", x, "y=", y, "z=", z) receive cluck(s) write("chicken receive cluck, s=", s) send foxy.quick(true) end chick end chicken resource fox import chicken op quick(e : bool) body fox() var chick : cap chicken var y : bool write("fox is alive") chick := create chicken(myresource()) # `call peep' blocks until chicken executes `receive peep' call chick.peep(1, 2.0, 'c') # `call' is optional and can be omitted send chick.cluck("non-blocking") receive quick(y) write("fox receive quick, y=", y) end fox /* ............... Example compile and run(s) % sr -o send_receive send_receive.sr % ./send_receive fox is alive chicken is alive chicken receive peep, x= 1 y= 2.00000 z= c chicken receive cluck, s= non-blocking fox receive quick, y= true */