100 likes | 229 Views
Migrating Protocols In Multi-Threaded Message-Passing Systems. Austin Anderson, HotSWUp ‘09. Safe Dynamic Software Update. Want preserve high level behaviors Message passing is one paradigm for inter-thread communication
E N D
Migrating Protocols In Multi-Threaded Message-Passing Systems Austin Anderson, HotSWUp ‘09
Safe Dynamic Software Update • Want preserve high level behaviors • Message passing is one paradigm for inter-thread communication • We can guarantee that a system of parallel threads pass messages according to a specified protocol
Session Types G ::= p →p : < T > Send a value of type T from sender p to recipient(s) p | G.G sequential comp | μt.G recursion | t recursive var
Math Server Example G = p1→ p2 : < int > p1→ p2 : < int > p2→ p1 : < int> p1 p2 int send receive int send receive int receive send
If we update p1 and p2 separately p1 p2 int send receive int send ERROR! no receive int receive send
Update Coordination • Relies on static analysis which guarantees that after an update to a specific thread it will perform the new protocol • Work is completed in a submitted paper - copies available • To safely update the whole system we have to coordinate these individual updates
Update Coordination Mechanism • Asynchronous global queue for communication • Messages sent under the old protocol will be consumed before messages sent under the new protocol become visible • We ensure that for every send that we perform a receive
Producer Consumer Example p1 p2 G =μt.p1→ p2 : < int > p1→ p2 : < int > p1→ p2 : < bool > t μt. int receive send int receive send bool send receive t Queue 2 3 t 4 5 f 6 7 t 8 f
Future Work • Preserving behaviors in multi-threaded shared state access • e.g. a piece of mutable state which can be read by multiple threads but only written by one (MRSW) • Generalised resource usage preservation which can represent • message passing • the above shared state which is accessed according to some pattern
Conclusion • We can use a static analysis to guarantee each individual thread will have the new protocol after an update • System update safety is a coordination problem • Future work will generalize this to other high level behaviours/resource usages