Development of a Distributed Task Bag Using CORBA
Development of a Distributed Task Bag Using CORBA Frank Mc. Cown Operating Systems – UALR Dec. 6, 2001
Task Bag Concept originated from Linda system at Yale as distributed memory. Master/Slave paradigm tasks & data Master results Worker Task Bag Worker results Worker
Task Bag Operations 1. pair. Out(key, value) – Adds the Pair (key/value) to the Task Bag. If a Pair already exists with the same key, that Pair is replaced with the new Pair. 2. pair. In(key) value – Causes some Pair in the Task Bag that matches key to be withdrawn from the Task Bag. The value part of the Pair is returned. If no matching Pair is available, an empty value is returned to the caller. 3. read. Pair(key) value – Same as pair. In except the Pair is not removed from the Task Bag.
Tasks for Task Bag Any problem that can be divided into sub-tasks and solved in parallel: Searching for text in multiple files l Finding set of prime numbers l Computing fractal images l Performing matrix multiplication l
Matrix Multiplication 0 1 2 3 -14 – 8 – 2 1 2 3 4 -1 0 1 2 -20 -10 0 10 2 3 4 5 -2 -1 0 1 3 4 5 6 A X = 4 -26 -12 2 16 -3 -2 -1 0 -32 -14 4 22 B Result Each Result[R, C] is computed using row R from A and column C from B.
Implementation Task Bag is distributed object 2 choices for implementing distributed system: Java RMI l CORBA - ORBacus l Programming language: Java Platform: Any
Task Bag Pairs Data Pairs – Matrix rows and columns for use by Workers Task Pairs – Row and Column to be calculated for Workers Result Pairs – Result of calculation for Row and Column for Master
Event Notification Master must be notified when results are available. Workers must be notified when work is available.
Order of Events 1) Register for Notification 2) Data Pairs pair. Out Master 3) First Task Pair pair. Out 9) Notification of Result Pair 10) pair. In Result Pair 4) Notification of Task Pair Task Bag 5) pair. In Task Pair 6) Task Pair pair. Out Worker 7) pair. In Data Pair 8) Result Pair pair. Out 11) Deregister
interface Task. Bag IDL { oneway void pair. Out(in string key, in string value); oneway void pair. Out. Task(in string key, in string value); oneway void pair. Out. Result(in string key, in string value, in string worker. Name); string pair. In(in string key); string pair. In. Task(in string key, in string worker. Name); string read. Pair(in string key); };
Demo Start Naming Service. start java com. ooc. Cos. Naming. Server –ORBconfig project. conf Start Master. java Task. Master Start Workers. java Worker Place tasks in Task Bag for Workers to do.
- Slides: 11