Download presentation
Presentation is loading. Please wait.
Published byCadence Foots Modified over 10 years ago
1
CS-495 Distributed Systems Fabián E. Bustamante, Winter 2004 Processes Threads & OS Threads in distributed systems Object servers Code migration Software agents
2
CS-495 Distributed Systems Threads Idea – we build virtual processors in software –Processor, processes and threads Context switch –Process and thread context –Observations Threads shared the same address space Process switching involves getting the OS in the loop - >$ Creating and destroying threads is cheaper than doing so with processes Threads and the OS –User or kernel threads? –Two level threading and scheduler activations
3
CS-495 Distributed Systems Threads in Distributed Systems Multithreaded clients – to hide network latency –Web client –RPCs Multithreaded servers – improve performance & structure –Starting a thread is cheaper than starting a process –A single-threaded server is a problem for scalability –Move on to next request instead of waiting –Using blocking calls simplifies overall structure –Simplified flow control (?)
4
CS-495 Distributed Systems Alternatives to Threaded Servers Alternatives Problems with threads? –Hard to program: synchronization & deadlocks –Hard to debug: data and timing dependencies –Hard to get good performance –Should you abandon threads? No – but avoid them if you can ModelCharacteristics ThreadsParallelism, blocking system calls Single-threaded processNo parallelism, blocking system calls Finite-state machineParallelism, nonblocking system calls
5
CS-495 Distributed Systems Servers – Design Issues General organization –Basic model & superservers (inetd) Out-of-band communication –Use a separate port –Use a special message State –Stateless – no memory/no problem –Stateful – faster + reliability headache Object servers –Objects – data/state + method –Transient and persistent objects, thread per object or per invocation … –Activation policies and object adapters
6
CS-495 Distributed Systems Code Migration Why? –Performance –Flexibility Models –Process segments: Code: set of instructions Resource: external resources needed (files, printers, …) Execution: current execution state –...
7
CS-495 Distributed Systems Models for Code Migration
8
CS-495 Distributed Systems Migration and Local Resources Problem: what if resources are not available at target? Type of resources: –Fixed: it cannot be migrated –Fastened: it can but it will cost you a lot –Unattached: easy to move UnattachedFastenedFixed By identifier By value By type MV (or GR) CP ( or MV, GR) RB (or GR, CP) GR (or MV) GR (or CP) RB (or GR, CP) GR RB (or GR) Resource-to machine binding Process-to- resource binding MV: just move it GR: Establish global systemwide refer CP: Copy the value of the resource RB: Re-bind to a locally available resource
9
CS-495 Distributed Systems Migration in Heterogeneous Systems Main problem: –Target machine may not be suitable to run it –The def. of process/thread/processor context is highly dependent on HW/OS/Runtime system One solution: use abstract machine Current solutions: –Interpreted languages running on virtual machine –State the migration points
10
CS-495 Distributed Systems Whats an Agent? Def.: Autonomous process that can react/initiate changes in its environment, possible in collaboration –Collaborative agents –Mobile agents –Interface agents –Information agents Property Common to all agents? Description AutonomousYesCan act on its own ReactiveYesResponds timely to changes in its environment ProactiveYesInitiates actions that affects its environment CommunicativeYesCan exchange information with users and other agents ContinuousNoHas a relatively long lifespan MobileNoCan migrate from one site to another AdaptiveNoCapable of learning
11
CS-495 Distributed Systems Agent Technology Management: Keeps track of where the agents on this platform are Directory: Mapping of agents names and attributes to agent IDs ACC: Agent Communication Channel – used to communicate with other platforms
12
CS-495 Distributed Systems Agent Communication Languages ACL is application-level protocol making distinction bet/ purpose and content of msg. Message purposeDescription INFORMInform that a given proposition is true QUERY-IF Query whether a given proposition is true QUERY-REFQuery for a give object CFPAsk for a proposal PROPOSEProvide a proposal ACCEPT-PROPOSALTell that a given proposal is accepted REJECT-PROPOSALTell that a given proposal is rejected REQUESTRequest that an action be performed SUBSCRIBESubscribe to an information source FieldValue PurposeINFORM Senderweather@http://www.weather.com:7239 Receivermafalda@http://www.cs.nwu.edu:5623 LanguageProlog Ontologyweather Contentweather(today,60201,sunny)
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.