Distributed Systems Ch7
Distributed Systems Ch7
2
Introduction to Operating Systems in Distributed
Systems
The figure shows the core OS functionality that we shall be concerned with: process
and thread management, memory management and communication between
processes on the same computer (horizontal divisions in the figure denote
dependencies). 5
Middleware and OS Interaction
The figure shows how the operating system layer at each of two nodes supports a
common middleware layer in providing a distributed infrastructure for applications
and services.
7
Key Components of OS
8
Encapsulation in OS
• Definition:
• Process: A program in execution, which includes the
program code, current activity, and allocated resources
(memory, file handles).
• Thread: A smaller unit of a process that can run
independently, sharing the same memory space with other
threads in the same process.
• Features:
• Concurrency: Multiple threads can execute simultaneously,
improving application responsiveness and performance.
• Resource Sharing: Threads within the same process share
resources, making inter-thread communication faster and
more efficient.
11
Processes and Threads
• Usage:
• Web Servers: Use threads to handle multiple
client requests simultaneously (e.g., Apache
HTTP Server).
• Multimedia Applications: Use threads for audio
and video processing to maintain smooth
playback (e.g., VLC Media Player).
• Examples:
• Microsoft Word: Uses multiple threads to handle
user input while performing background tasks
like spell checking.
12
Communication and invocation
13
Communication and invocation
15
Communication and invocation
16
Communication and invocation
18
OS Architectures
19
OS Architectures
Monolithic Kernels
includes a wide range of services and functionalities within a single large
block of code.
So, device drivers, file system management, and network protocols, run in
kernel space.
Advantages:
• High Performance: because it allows for direct communication between
services without the overhead of context switching between user and kernel
modes.
• Simplicity: For certain applications, having all services in one place can
simplify the design and implementation.
Disadvantages:
• Stability: a failure in one part of the kernel can crash the entire system.
• Limited Flexibility: Adding new features or modifying existing ones can
require recompiling the entire kernel, which can be cumbersome.
20
OS Architectures
Microkernels
Microkernels, on the other hand, aim to
minimize the amount of functionality included in
the kernel itself. They provide only the most
essential services, such as low-level address
space management, thread management, and
interprocess communication (IPC). Other
services, like device drivers and file systems,
run in user space as separate processes.
21
OS Architectures
Microkernels
Advantages:
• Modularity: The separation of services allows for
easier updates and maintenance. New services can
be added without modifying the kernel.
• Stability and Security: Since most services run in
user space, a failure in one service does not
necessarily compromise the entire system. This
isolation can enhance security.
• Flexibility: Microkernels can be more easily adapted
to different environments, making them suitable for
various applications, including distributed systems.
22
OS Architectures
Microkernels
Disadvantages:
•Performance Overhead: The need for IPC between
user-space services can introduce performance
overhead, as communication between processes is
generally slower than within a monolithic kernel.
•Complexity in Design: Designing a microkernel
system can be more complex due to the need for
efficient IPC mechanisms and the management of
multiple user-space services.
23
OS Architectures
26