Concepts of Distributed Systems 2006/2007: Processes
Concepts of Distributed Systems 2006/2007: Processes
2006/2007
Processes
Johan Lukkien
• Naming
• Fault Tolerance
• Thread
– unit of concurrency
– unit of scheduling
• though with one thread per process, a process is often said to
be the unit of scheduling
– several threads ‘live’ within shared address space
• i.e., in a process
Process Thread
• A context switch
– changes the memory management settings
– is needed, besides a mode switch, for only some events, e.g. if a
process switch is needed
pthread_t thread_id;
released
ready blocked
pre-empted wait (resource,
scheduled condition, time, event)
initially
running done (function return),
or cancelled
terminated
removed
detached or joined
• Server
– handle multiple clients
• easy extension to multi-processor box
– hide blocking services (e.g. disk access)
• ...ease of programming
• Client state
– Server side
• preferred: stateless (open files, caches,..)
• performance, complexity, scalability (1 Mb for 1000 clients is
1Gb ....)
– Client side
• cookies, web-page content
• Policies:
– transient
• create upon initialization/1st access
• destroy upon server down/last client away
– memory sharing
– threading
• per object?
– access & activation
• skeleton: (un)marshalling, actual call
• adapter: implements policy; registers object
• request (de)multiplexing
• Locality:
– run code where data is
– multiply code over data sources
• Postpone decisions
– dynamic configuration
– late binding
• State
– execution segment
– data
• Strong mobility
– also exchange execution segment
• Cloning
– make exact copy – similar to UNIX fork(), but then child
process is remote
• Solutions
– Define virtual machine
• language interpretation
– Limit migration points
• translate into migratable format
Communicative Yes Can exchange information with users and other agents
Field Value
Purpose INFORM
Sender max@http://fanclub-beatrix.royalty-spotters.nl:7239
Receiver elke@iiop://royalty-watcher.uk:5623
Language Prolog
Ontology genealogy
Content female(beatrix),parent(beatrix,juliana,bernhard)
• Dynamic
– react to dynamically changing load
• Pre-emptive
– stop process for migration
• No a priori knowledge
– burdens user with additional specification
• Efficient
– quick decision
• precision; real-time
– balance migration & information gathering
n1 n2 n3 n1 n2 n3
load high low high low high low
• Fault tolerance
– node failure: continue for remaining nodes
– link failure: continue for connected nodes
static dynamic
cooperative non-cooperative
high
dispatch accept
high yes no normal
normal no no
low no yes low
• Receiver initiated
– lightly loaded nodes look for load
– typically requires pre-emptive migration
• more expensive (need to record execution state)
• Minimum load
– probe load at N random destinations
– transfer process to node with lowest load that is below threshold;
execute locally otherwise
• Bidding
– each node is seller (manager) and buyer (contractor)
– seller broadcasts a request for bids
– buyers send their bids containing info concerning node
capabilities; e.g. available processor/memory capacity
– manager approaches bidders (from best to worst)
• Polling
– active checking
• Periodic Broadcast
– heavy network traffic
– poor scalability (#messages increases)
– data may not be needed
• Improvements
– send data only after (significant) load-change
– send data after request (by a high-load node)
– reply only if can help in balancing
• Intermediate
– if #local processes > #remote processes
then local > remote
else remote > local
• Controlled
– set a maximum to number of migrations per process (process
keeps track of migration count)
• 1: irrevocable (typically static)
• k: may be decided (dynamically) based on process characteristics