distributed c3

Cards (62)

  • Processes in distributed systems
    1. How the different types of processes play a crucial role
    2. Management and scheduling of processes are important issues
    3. Issues in distributed systems that are equally or more important than process management
  • Multithreading techniques

    • Allow clients and servers to be constructed such that communication and local processing can overlap, resulting in a high level of performance
  • Virtualization
    • Allows an application, and possibly also its complete environment including the operating system, to run concurrently with other applications, but highly independent of the underlying hardware and platforms, leading to a high degree of portability
    • Helps in isolating failures caused by errors or security problems
  • Process migration or code migration
    1. Can help in achieving scalability
    2. Can help to dynamically configure clients and servers
  • Process
    A program in execution, that is, a program that is currently being executed on one of the operating system's virtual processors
  • Processes
    • Operating system takes great care to ensure that independent processes cannot maliciously or inadvertently affect the correctness of each other's behavior
    • Concurrency transparency comes at a relatively high price
  • Thread
    • Executes its own piece of code, independently from other threads
    • No attempt is made to achieve a high degree of concurrency transparency if this would result in performance degradation
  • Threads
    • The performance of a multithreaded application need hardly ever be worse than that of its single-threaded counterpart
    • Development of multithreaded applications requires additional intellectual effort
  • Thread usage in non-distributed systems
    1. Handling interaction with the user and updating the spreadsheet
    2. Exploiting parallelism when executing the program on a multiprocessor system
    3. Cooperation between programs in large applications
  • Interprocess communication (IPC) mechanisms
    • The major drawback of this is that Communication often requires extensive context switching
  • Thread implementation
    1. User-level thread library
    2. Kernel-level threads
    3. Lightweight processes (LWP)
  • User-level threads
    • Cheap to create and destroy
    • Switching thread context can often be done in just a few instructions
    • Invocation of a blocking system call will immediately block the entire process
  • Kernel-level threads
    • Every thread operation (creation, deletion, synchronization, etc.) will have to be carried out by the kernel requiring a system call
    • Switching thread contexts may now become as expensive as switching process contexts
  • Lightweight processes (LWP)

    • Run in the context of a single (heavy-weight) process, and there can be several LWPs per process
    • Thread package is implemented entirely in user space, all operations on threads are carried out without intervention of the kernel
    • Blocking system call will not suspend the entire process
  • When a thread does a blocking system call, execution changes from user mode to kernel mode, but continues in the context of the current LWP. At the point where the current LWP can no longer continue, the operating system may decide to switch context to another LWP, which also implies that a context switch is made back to user mode.
  • Advantages of using LWPs in combination with a user-level thread package
    • Creating, destroying, and synchronizing threads are relatively cheap and involves no kernel intervention at all
    • Blocking system call will not suspend the entire process if a process has enough LWPs
    • No need for an application to know about the LWPs, all it sees are user-level threads
    • LWPs can be easily used in multiprocessing environments, by executing different LWPs on different CPUs
  • The drawback of lightweight processes in combination with user-level threads is that we still need to create and destroy LWPs, which is just as expensive as with kernel-level threads.
  • Creating and destroying LWPs needs to be done only occasionally, and is often fully controlled by the operating system.
  • Threads in distributed systems
    • They can provide a convenient means of allowing blocking system calls without blocking the entire process in which the thread is running
    • This makes it much easier to express communication in the form of maintaining multiple logical connections at the same time
  • Multithreaded clients

    They can hide communication latencies by initiating communication and immediately proceeding with something else
  • Web browsers
    • They start displaying data while it is still coming in, and continue fetching other files that make up the page, such as the images
  • Using multithreaded Web browsers, connections may be set up to different replicas, allowing data to be transferred in parallel, effectively establishing that the entire Web document is fully displayed in a much shorter time than with a non-replicated server.
  • Multithreaded servers

    • They not only simplify server code considerably, but also make it much easier to develop servers that exploit parallelism to attain high performance, even on uniprocessor systems
  • Organization of a file server
    1. Dispatcher thread reads incoming requests for a file operation and hands them to an idle worker thread
    2. Worker thread performs a blocking read on the local file system, which may cause the thread to be suspended until the data are fetched from disk
    3. Another thread is selected to be executed while the worker thread is suspended
  • In the absence of threads, a file server operating as a single thread would be idle while waiting for the disk, and would not be able to process requests from other clients.
  • Threads make it possible to retain the idea of sequential processes that make blocking system calls and still achieve parallelism.
  • The single-threaded server retains the ease and simplicity of blocking system calls, but gives up some amount of performance. The finite-state machine approach achieves high performance through parallelism, but uses non-blocking calls, thus is hard to program.
  • Virtualization
    It allows building (pieces of) programs that appear to be executed simultaneously, even on a single-processor computer
  • Role of virtualization in distributed systems
    • It can help port legacy software to new platforms
    • It can reduce the diversity of platforms and machines by letting each application run on its own virtual machine, possibly including the related libraries and operating system, which run on a common platform
    • It provides a high degree of portability and flexibility, allowing dynamic replication of complete sites including their environment
  • Interfaces offered by computer systems
    • Hardware-software interface
    • Instruction set interface
    • Operating system interface
    • Application programming interface
  • Virtualization deals with extending or replacing an existing interface so as to mimic the behavior of another system.
  • Virtualization
    • Provides a high degree of portability and flexibility
    • Allows for the isolation of a complete application and its environment, so a failure caused by an error or security attack need no longer affect a complete machine
    • Provides a further decoupling between hardware and software, allowing a complete environment to be moved from one machine to another
  • Virtualization approaches
    • Process virtual machine
    • System virtual machine (virtual machine monitor)
  • Process virtual machine
    Provides an abstract instruction set to be used for executing applications
  • System virtual machine (virtual machine monitor)
    Provides a layer that completely shields the original hardware but offers the complete instruction set of that same (or other hardware) as an interface, allowing multiple and different operating systems to run independently and concurrently on the same platform
  • Virtualization can take place in two different ways: process virtual machine or system virtual machine (virtual machine monitor)
  • Networked user interfaces
    • Provide direct access to remote services by only offering a convenient user interface, effectively using the client machine as a terminal with no need for local storage (thin-client approach)
    • Ease the task of system management
  • X Window System
    A networked user interface that controls bit-mapped terminals and provides a relatively low-level interface for controlling the screen, capturing events from the keyboard and mouse, and making these available to applications through a library called Xlib
  • The X kernel acts as a server, while the applications play the role of clients in the X Window System
  • THINC
    • Intercepts application display requests and translates them into lower level commands
    • Batches several commands to aggregate display commands into a single one, leading to fewer messages
    • Always pushes updates to the display as they come available, instead of letting the display ask for refreshments, saving latency