Computer Science 441

Principles of Distributed Systems

Gregory M. Kapfhammer

flickr photo shared by Patrick Brosset under a Creative Commons ( BY-NC ) license

Color Scheme

Key Concept

Corresponding Diagram

In-Class Discussion

In-Class Activity

Details in the Textbook

Processes and Threads

Low-level design of clients and servers

Focus on server creation

Processes support management and scheduling

Overlap messaging and processing

Develop a real-world example of thread usage!


Check dependencies between cells

Handle user interaction

Backup the spreadsheet to the cloud

Exploit the multiple cores on the CPU

What would a spreadsheet be like without multiple processes and threads? Why?

flickr photo shared by The Young Ryan G under a Creative Commons ( BY-ND ) license


Program in execution

Process table tracks all of the processes

CPU register values, memory maps, and open files

Accounting details and access privileges

Processes should execute independently

Concurrency transparency costs are great!

Is there an alternative to using processes?


Similar to a process

Has a distinct code segment

Very little context is stored

Does not achieve full concurrency transparency

What are the trade-offs between processes and threads?

Consider the costs of context switching!

Threads are cheap to create and destroy!

What is the key weakness of threads?

Is there a "hybrid" solution?

See Figure 3-2 for a depiction of LWPs

Real-world example of a multi-threaded server


What is the general meaning of this term?

How is it specialized for operating systems?

One key approach is resource virtualization

So, "pick an interface and emulate it"

What is the motivation behind this technique?

flickr photo shared by Ars Electronica under a Creative Commons ( BY-NC-ND ) license


HDW to SW: all machine instructions

HDW to SW: privileged instructions

Systems calls: user to kernel level

Library calls: user to user level

Virtualization mimics behavior at interfaces!

flickr photo shared by Ars Electronica under a Creative Commons ( BY-NC-ND ) license

Virtualization is not "new"!

What are the costs of virtualization?

What are the benefits of virtualization?

Virtualization improves reliability and security

Virtualization improves resource utilization

Virtualization improves portability

Virtualization supports legacy software

Why have virtualization in a distributed system?

Discuss the role of clients and servers

Discuss the limits of using these roles

Investigate X11 forwarding

What is the client? The server? Why?

See Figure 3-9 for more details

Server replication

See Figure 3-10 for more details


Servers have hosts and ports

Iterative versus concurrent

Super-server versus daemon

Stateless versus stateful

What are the trade-offs of these design decisions?

flickr photo shared by Stanford EdTech under a Creative Commons ( BY-NC-ND ) license

Code Migration

Process Migration

Load balancing versus load sharing?

Mobile Agents

Code, resource, and execution segments


Remember the segments of a process

Strong versus weak

Receiver versus sender initiated

See Figure 3-18 for the alternatives

How would we classify a Java applet?

flickr photo shared by International Transport Forum under Creative Commons ( BY-NC-ND )

Resource management

Resource unavailable on a remote machine

Code downloading

What is the best way to download code for a remote service?

Challenges for code downloading

Solutions for code downloading

See Figure 3-17 for more details

Migration and local resources

See Figure 3-19 for more details