introduction)
In front of the main introduction of some direct communication and indirect communication, including some of the middleware technology, this time I learn the content is the level down, in a word, in the form of a distributed system operating system level for the middleware support. In this article, we mainly focus on some support for communication with the operating system level, including remote calls such as RPC.
hierarchy of the operating system)
The operating system is a software system above pure hardware resources, which encapsulates the abstraction of hardware, memory management, I/O management, CPU management and so on.
1. Middleware runs on a variety of operating systems, in various nodes in the distributed system. The different nodes support a common middleware layer.
2. All the hardware resources in the distributed system are exposed to the various services in the form of interfaces.
3. The core of an operating system consists of process management, communication management, thread management, memory management and monitoring management modules.
protection)
The main emphasis here is on illegal access, including some illegal operations. For example, you only have to read the A file permissions, you can not perform the operation of modifying the file, when you have the ability to write permissions, you can not make the deletion of files.
1. An operating system's kernel refers to a bunch of code for operating system initialization.
2. Many address spaces are also set up in the kernel to control access between different processes, and an address space is a series of virtual memory addresses.
3. A process can be transformed from the user address space to the kernel address space by an exception, such as an interrupt or a system call.
processes and Threads)
Processes and threads This 2 concept is believed to have been heard by everyone, obviously the concept of a process is larger and the thread is contained in the process.
1. A process is associated with a number of activities, a process within which an execution environment and one or more threads are included.
2. An initial implementation environment consists of an address space, a communication interface, such as a socket, some high-level resources such as file, and so on.
3. Address space refers to a process of virtual memory of the management unit, he is often relatively large, including many regions, in different regions, contains a number of different content attributes, thread operation permissions, address size and so on.
4. What we call virtual memory systems actually map memory addresses to the actual physical memory addresses of each.
5. Create a process in the operating system, can be seen as a 2-step operation, the first select a process to create the host machine, and then create the execution environment above.
6. When the process calls the fork method for the copy process operation, it is rewritten to replicate a process that is the same as the parent process, they started out as a common region, the address space is exactly the same, when the child process to modify the contents of the content, the additional address space is copied, This is called Copy-on-write copy-on-write policy.
7. The overhead of creating a thread is less expensive than creating a process because the thread is still in his execution environment, the resources around it are not changed, and the process is recreating an execution environment, and the same thread switching is less than the process overhead.
Communication and invocation)
The operating system supports some of the more popular communication protocols, such as the TCP/IP protocol.
1. In the miscellaneous distributed system, the most important problem of communication is the high delay. The data transfer time may be longer than the operation time of the call.
2. A complete remote invocation process goes through the following process: 1. Client integration of data, Packaging 2. The data is copied, because the middle will involve the buffer3 of each layer. The initialization of the package, to initialize the contents of the head inside, and calculate the checksum and so on. 3. Thread scheduling and context switching, RPC at the kernel level for communication operations. These are the possible reasons for latency delay again.
3. Also mentioned here is a LPRC, lightweight rpc,lightweight PRC, which refers to both the client and the server on the same machine, equivalent to a local call.
4. The mode of call between communication is divided into synchronous mode and the way of asynchronous invocation, in the latter in the subdivision, there is a more permanent asynchronous call, is used to solve the situation often fail the connection. QRPC is an implementation example, the asynchronous call request exists in the queue, you connect if disconnected, and so you connect, the request is still in.
structure of the operating system)
In the structure of the operating system, the main sub-Class 2 monolithic kernel (single core), and micro-kernel (micro-core), the single core is relatively large, the service of each module is to achieve good, but also used more widely, such as most of the current Linux system, Are all based on a single core approach. While the micro-core is relatively small, but he is more flexible, it contains only the simplest, most basic modules, the entire structure to achieve the greatest abstraction.
Virtualization of the operating system layer)
Operating system Virtualization In a nutshell, you can run multiple operating systems on the same machine, but share the same hardware resources.
1. The virtualization of the operating system can be used in some of the following ways: 1. Virtual machines can be ported in many ways. 2. Can be used to do some cloud-related things, using powerful physical conditions facilities. 3. Run multiple OS systems on a single PC.
2. To achieve the virtualization of the operating system, it is necessary to have a layer of virtual machine monitor and VM monitoring layer between the hardware resources and the top operating system images. This monitor provides a resource interface for the virtual operating system on the upper level, while mapping the resources in the mirror to the underlying resources.
3. One example of learning is Xen, a virtual machine monitor, and Xen is a typical example of operating system virtualization. His Xen hypervisor is a function of the dry middle tier.
References: <<distributed sysytems Concepts and design>> original version fifth, Author:george Coulouris,jean Dollimore, Tim Kindberg,gordon Blair
Distributed System reading notes (vii)-----operating system support