Presentation is loading. Please wait.

Presentation is loading. Please wait.

Task Bag A Distributed System using the.NET Framework and Remoting Frank McCown Old Dominion University Spring 2005 CS 875 Distributed Systems - Final.

Similar presentations


Presentation on theme: "Task Bag A Distributed System using the.NET Framework and Remoting Frank McCown Old Dominion University Spring 2005 CS 875 Distributed Systems - Final."— Presentation transcript:

1 Task Bag A Distributed System using the.NET Framework and Remoting Frank McCown Old Dominion University Spring 2005 CS 875 Distributed Systems - Final Project

2 Introducing Remoting Framework for remote method invocations in a.NET application Similarities to CORBA and Java RMI Can integrate with non-.NET applications using SOAP over HTTP Replaces Microsoft’s DCOM More: Advanced.NET Remoting by Ingo Rammer and Mario Szpuszta http://msdn.microsoft.com/library/default.asp?url=/li brary/en-us/dndotnet/html/introremoting.asp http://msdn.microsoft.com/library/default.asp?url=/li brary/en-us/dndotnet/html/introremoting.asp

3 Remoting Example using C# Client Server RemoteHello TCP Binary

4 Server using System; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp; namespace RemotingSamples { public class Server { public static void Main(string[] args) { ChannelServices.RegisterChannel(new TcpChannel(8085)); RemotingConfiguration.RegisterWellKnownServiceType( Type.GetType("RemotingSamples.RemoteHello,object"), “RemoteHello", WellKnownObjectMode.SingleCall); System.Console.WriteLine(“Server is running. Hit Enter to exit."); System.Console.ReadLine(); }

5 Remote Object using System; namespace RemotingSamples { public class RemoteHello : MarshalByRefObject { public String SayHello(String name) { return "Hello, " + name; }

6 Client using System; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp; namespace RemotingSamples { public class Client { public static void Main(string[] args) { ChannelServices.RegisterChannel(new TcpChannel()); RemoteHello obj = (HelloServer)Activator.GetObject( typeof(RemotingSamples.RemoteHello), "tcp://serverX:8085/RemoteHello"); Console.WriteLine(obj.SayHello(“Bob")); }

7 Task Bag Overview Distributed system based on master/slave paradigm Master produces Tasks for Workers to complete Task Bag is a repository for Tasks and Results Task Master Worker Task Bag Tasks Results Tasks Worker

8 Task Bag Operations Task Masters void RegisterMaster(string masterName, TaskMasterCallback callback) void RemoveMaster(string masterName) void AddTask(Task task) int GetResult(string taskId) Workers void RegisterWorker(Worker worker) void RemoveWorker(string workerName) Task GetTask(string workerName) (asynchronous callback) void AddResult(Task task)

9 Tasks for Task Bag Any problem that can be divided into sub-tasks and solved in parallel: Searching for text in multiple files Finding a set of prime numbers Computing fractal images Performing matrix multiplication Etc.

10 Matrix Multiplication Each Result[R,C] is computed using row R from A and column C from B. 0 1 2 3 1 2 3 4 2 3 4 5 3 4 5 6 X= 0 1 2 3 -1 0 1 2 -2 -1 0 1 -3 -2 -1 0 -14 –8 –2 4 -20 -10 0 10 -26 -12 2 16 -32 -14 4 22 ABResult

11 System Operation Task Master Task BagWorker RegisterMaster RegisterWorker AddTask (1..N) GetTask Task Work on Task Submit Tasks and wait for results AddResult ReceiveMessage (callback) Receive result and display GetTask Task AddResult Startup Notify Master

12 Task Bag - Task Queue Tasks exist in one of 3 states: Unassigned (waiting for a Worker) Assigned (to a Worker) Complete (waiting for Task Master) Unassigned tasks wait in Task Queue Task Bag Task Incoming Tasks from Task Master Assigned to Worker Task Queue Task

13 Fault Tolerance Task Masters could die Task Bag keeps solved Tasks until Task Master is able to retrieve later Workers could die Tasks assigned to Workers are reassigned after some timeout period Task Bag could die Multiple replica Task Bags are used as backups if primary dies

14 Task Bag Backups Passive (primary-backup) replication Front Ends used to communicate to primary Task Bag Worker Task Master FE Task Bag Task Bag Task Bag Primary Backups FE

15 Passive Replication Operation Example 1. Worker requests for Task 2. FE contacts primary TB with request 3. Primary TB finds Task to assign to Worker 4. Primary TB informs backup TBs of Task assignment (assignment is ACKed) 5. Primary TB returns Task to Worker

16 Task Bag Goes Down If FE is unable to contact the primary TB, the next TB becomes the primary The new primary TB sends state changes to all backup TBs As new backup TBs come on line, primary TB transfers state to make new backup consistent with primary

17 Demo Startup Task Bag Startup Front End (same FE can be used for all Workers and Task Masters) Startup Task Master Startup Workers

18 Conclusion System is extremely robust Care must be taken to start applications in the correct order Software and slides can be obtained at http://www.cs.odu.edu/~fmccown/research/remoting_taskbag/ http://www.cs.odu.edu/~fmccown/research/remoting_taskbag/


Download ppt "Task Bag A Distributed System using the.NET Framework and Remoting Frank McCown Old Dominion University Spring 2005 CS 875 Distributed Systems - Final."

Similar presentations


Ads by Google