Ch3 Processes
Ch3 Processes
3
Distributed
Context Switching Systems
A technique used for pausing what the system is doing and taking on
another “possibly” urgent job.
During a context switch, a system shall:
1. Save the context of the current job so that it can resume back from where it has left
off
2. Load the context of the new job
4
Distributed
Benefits of multi-threading Systems
9
Distributed
Kernel-level solution Systems
10
Distributed
Cont… Systems
Cons:
Expensive:
Every thread operation (creation, deletion, synchronization, etc.) will have to be carried
out by the kernel.
Thread context switching may become as expensive as process context switching.
Another Solution:
Mixing user-level and kernel-level threads into a single concept.
Light-weight process
The performance gain is compromised by its complexity
This concept has been virtually abandoned – it’s just either user-level or kernel-level threads.
11
Distributed
Threads in Distributed Systems Systems
12
Distributed
Cont… Systems
13
Distributed
Multi-threaded servers Systems
Figure. A multithreaded
server organized in a
15 dispatcher/worker model.
Distributed
Virtualization Systems
Virtualization refers to the act of creating a virtual (rather than actual ) version of
something,
Such as computer hardware platforms, storage devices, and computer network resources.
It is a logical separation of the request for some service from the physical resources
that actually provide that service
Why virtualization?
Portability
Liberates applications, system services, and even the OS that supports them from being tied
to a specific piece of hardware
17
Distributed
The Role of Virtualization in DS Systems
Figure (a) General organization between a program (b) General organization of virtualizing system A on top
, interface, and system. of system B.
18
Distributed
Architectures of Virtual Machines Systems
19
Distributed
Logic View of Four Interfaces Systems
Generally, Virtualization can take place at very different levels, strongly depending on
the interfaces as offered by various systems components
20
Distributed
Ways of virtualization Systems
Often, virtualization can take place in two different ways
Build runtime system that provides instruction set to be used for executing applications
Instructions can be interpreted (JVM)
Instructions can be emulated (Running Windows applications on Unix platforms (Wine)
The emulator has to mimic the system calls
Provide a system that is essentially implemented as a layer completely shielding the origin
al hardware
The layer is called virtual machine monitor (VMM)
It offers the complete instruction set of that same (or other hardware) as an interface
Examples: VirtualBox, VMware
21
Distributed
Process VMs versus VM Monitors Systems
(a). Process VM: A program is compiled to intermediate (portable) code, which is then executed by a runtime s
ystem (Example: Java VM).
(b) VM Monitor: A separate software layer mimics the instruction set of hardware ) a complete operating syste
m and its applications can be supported (Example: VMware, VirtualBox).
22
Distributed
VMs and cloud computing Systems
23
Distributed
Code Migration Systems
25
Distributed
Code Migration Examples Systems
Example 3:
System administrator may be forced to shut down a server but does not want to
stop the running processes (e.g. to change a part or even permanent shut down)
Temporarily freeze an environment, move to another machine and unfreeze
(e.g. for debugging server production issues)
27
Distributed
Approaches to Code Migration Systems
28
Distributed
Approaches to Code Migration Systems
Weak mobility
Move only code segment and some initialization data (and reboot execution):
The transferred program always start as new. E.g Java Applets
Strong Mobility:- Migrate all three segments
Migration: move entire object from one machine to the other
A process could be stopped, moved to another machine and resumed
execution where it left off.
Cloning: start a clone, and set it in the same execution state.
Multiple copies could run in parallel
29
Distributed
Models for Code Migration Systems
30
Distributed
Migration and Local Resource Systems
Problem
An object uses local resources that may or may not be available at the target
site.
Resource Types:
Fixed Resources: bound to a specific machine or environment and can not be
moved (e.g. Local disk drives, communication ports)
Re-Bind to locally available resources
Unattached resources: can easily be moved (e.g. Data files)
Move
Fastened resources: may be possible but very costly (e.g. local databases or c
omplete web sites)
Global references
31
Distributed
Migration in Heterogeneous Systems
Systems
Main problem
The target machine may not be suitable to execute the migrated code
The definition of process/thread/processor context is highly dependent on local
hardware, operating system and runtime system
Only solution - Virtualization
Make use of an abstract machine that is implemented on different platforms:
Interpreted languages, effectively having their own VM
Virtual machine monitors allowing migration of complete OS + apps.
Takes considerable time
During migration service will be unavailable
32
End of Chapter-3
33