Task%20Bag%20A%20Distributed%20System%20using%20the%20.NET%20Framework%20and%20Remoting - PowerPoint PPT Presentation

About This Presentation
Title:

Task%20Bag%20A%20Distributed%20System%20using%20the%20.NET%20Framework%20and%20Remoting

Description:

CS 875 Distributed Systems - Final Project. Introducing Remoting ... Computing fractal images. Performing matrix multiplication. Etc. Matrix Multiplication ... – PowerPoint PPT presentation

Number of Views:116
Avg rating:3.0/5.0
Slides: 19
Provided by: FrankM80
Learn more at: https://www.cs.odu.edu
Category:

less

Transcript and Presenter's Notes

Title: Task%20Bag%20A%20Distributed%20System%20using%20the%20.NET%20Framework%20and%20Remoting


1
Task BagA Distributed System using the .NET
Framework and Remoting
  • Frank McCownOld 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 Microsofts DCOM
  • More
  • Advanced .NET Remoting by Ingo Rammer and Mario
    Szpuszta
  • http//msdn.microsoft.com/library/default.asp?url
    /library/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.RegisterWellKnow
    nServiceType(
  • Type.GetType("RemotingSamples.RemoteHell
    o,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)Activat
    or.GetObject(
  • typeof(RemotingSamples.RemoteHello
    ),
  • "tcp//serverX8085/RemoteHell
    o")
  • 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

Worker
Tasks
Task Master
Worker
Task Bag
Tasks
Results
Worker
Results
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
X

A
B
Result
  • Each ResultR,C is computed using row R from A
    and column C from B.

11
System Operation
Task Master Task Bag Worker
Startup
Startup
Submit Tasks and wait for results
Work on Task
Receive result and display
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

Incoming Tasks from Task Master
Task
Task
Task Queue
Assigned to Worker
Task Bag
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

Primary
Worker
Task Bag
FE
Task Bag
Task Bag
Task Master
FE
Backups
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_t
    askbag/
Write a Comment
User Comments (0)
About PowerShow.com