操作系统中的处理机调度调度
多处理器操作系统 (Multiprocessor Operating system)
A multiprocessor system consists of several processors which share memory. In the multiprocessor, there is more than one processor in the system. The reason we use multiprocessor is that sometimes load on the processor is very high but input output on other function is not required. This type of operating system is more reliable as even if on processor goes down the other can still continues to work. This system is relatively cheap because we are only having the copies of processor but other devices like input-output and Memory are shared. In the multiprocessor system all the processor operate under the single operating system. Multiplicity of the processor and how the processors work together are transparent to the other.
多处理器系统由几个共享内存的处理器组成。 在多处理器中,系统中有多个处理器。 我们使用多处理器的原因是,有时处理器上的负载很高,但是不需要其他功能上的输入输出。 这种类型的操作系统更加可靠,即使在处理器出现故障时,其他操作系统仍然可以继续工作。 该系统相对便宜,因为我们只拥有处理器的副本,但其他设备(如输入输出和内存)是共享的。 在多处理器系统中,所有处理器都在单个操作系统下运行。 处理器的多样性以及处理器如何协同工作对彼此透明。
In this, the user does not know in which processor their process work. A process is divided into several small processes and they work independently on the different processor. A system can be both multi-programmed by having multiple programs running at the same time and multiprocessing by having more than one physical and the processor.
在这种情况下,用户不知道其处理在哪个处理器中进行。 一个进程分为几个小进程,它们在不同的处理器上独立工作。 一个系统可以通过同时运行多个程序来进行多程序编程,也可以通过拥有多个物理和处理器来进行多处理。
In this diagram, there are more than 1 CPU and they shared a common memory.
在此图中,有1个以上的CPU,它们共享一个公共内存。
多处理调度 (Multiprocessing scheduling)
In the multiprocessor scheduling, there are multiple CPU’s which share the load so that various process run simultaneously. In general, the multiprocessor scheduling is complex as compared to single processor scheduling. In the multiprocessor scheduling, there are many processors and they are identical and we can run any process at any time.
在多处理器调度中,有多个CPU共享负载,因此各种进程可以同时运行。 通常,与单处理器调度相比,多处理器调度比较复杂。 在多处理器调度中,有许多处理器,它们是相同的,我们可以随时运行任何进程。
The multiple CPU’s in the system are in the close communication which shares a common bus, memory and other peripheral devices. So we can say that the system is a tightly coupled system. These systems are used when we want to process a bulk amount of data. These systems are mainly used in satellite, weather forecasting etc.
系统中的多个CPU处于紧密通信中,共享一个公共总线,内存和其他外围设备。 因此,我们可以说该系统是紧密耦合的系统。 当我们要处理大量数据时,将使用这些系统。 这些系统主要用于卫星,天气预报等。
Multiprocessing system work on the concept of symmetric multiprocessing model. In this system, each processor work on the identical copy of the operating system and these copies communicate with each other. We the help of this system we can save money because of other devices like peripherals. Power supplies and other devices are shared. The most important thing is that we can do more work in a short period of time. If one system fails in the multiprocessor system the whole system will not halt only the speed of the processor will be slow down. The whole performance of the multiprocessing system is managed by the operating system . operating system assigns different task to the different processor in the system. In the multiprocessing system, the process is broken into the thread which they can be run independently. These type of system allow the threads to run on more than one processor simultaneously. In these systems the various process in the parallel so this is called parallel processor. Parallel processing is the ability of the CPU to run various process simultaneously. In the multiprocessing system, there is dynamically sharing of resources among the various processors.
多处理系统致力于对称多处理模型的概念。 在此系统中,每个处理器都在操作系统的相同副本上工作,并且这些副本彼此通信。 我们借助该系统可以节省其他设备(例如外围设备)的费用。 电源和其他设备是共享的。 最重要的是,我们可以在短时间内完成更多工作。 如果一个系统在多处理器系统中发生故障,则整个系统将不会停止运行,而只会降低处理器的速度。 多处理系统的整体性能由操作系统管理。 操作系统将不同的任务分配给系统中的不同处理器。 在多处理系统中,进程分为多个线程,它们可以独立运行。 这些类型的系统允许线程同时在多个处理器上运行。 在这些系统中,各种并行处理因此称为并行处理器。 并行处理是CPU同时运行各种进程的能力。 在多处理系统中,各个处理器之间动态地共享资源。
Multiprocessor operating system is a kind of regular OS which handles many systems calls at the same time, do memory management, provide file management also the input-output devices.
多处理器操作系统是一种常规OS,可同时处理多个系统调用,执行内存管理,还提供文件管理以及输入输出设备。
There are some extra features which multiprocessor perform:
多处理器还具有一些额外的功能:
Process synchronization
流程同步
Resource management
资源管理
Scheduling
排程
There are various organizations of multiprocessor operating system:
多处理器操作系统有多种组织:
1.每个CPU都有自己的操作系统 (1. Each CPU has its own OS)
In this types of the organization then there are much Central processing units in the system and each CPU has its own private operating system and memory is shared among all the processors and input-output system are also shared. All the system is connected by the single bus.
在这种类型的组织中,系统中有许多中央处理单元,每个CPU都有自己的专用操作系统,并且所有处理器之间共享内存,并且输入输出系统也共享。 所有系统通过单条总线连接。
2.主从多处理器 (2. Master slave multiprocessor)
In this type of multiprocessor model, there is a single data structure which keeps track of the ready processes. In this model, one central processing unit works as master and other central processing unit work as a slave. In this, all the processors are handled by the single processor which is called master server. The master server runs the operating system process and the slave server run the user processes. The memory and input-output devices are shared among all the processors and all the processor are connected to a common bus. This system is simple and reduces the data sharing so this system is called Asymmetric multiprocessing.
在这种类型的多处理器模型中,只有一个数据结构可以跟踪就绪的进程。 在此模型中,一个中央处理单元充当主控,另一个中央处理单元充当从属。 在这种情况下,所有处理器均由称为主服务器的单个处理器处理。 主服务器运行操作系统进程,而从服务器运行用户进程。 存储器和输入输出设备在所有处理器之间共享,并且所有处理器都连接到公共总线。 该系统非常简单,减少了数据共享,因此该系统称为非对称多处理 。
3.对称多处理器 (3. Symmetric multiprocessor)
Symmetric Multiprocessors (SMP) is the third model. In this model, there is one copy of the OS in memory, but any central processing unit can run it. Now, when a system call is made, then the central processing unit on which the system call was made traps to the kernel and then processes that system call. This model balances processes and memory dynamical. This approach uses Symmetric Multiprocessing where each processor is self-scheduling. The scheduling proceeds further by having the scheduler for each processor examine the ready queue and select a process to execute. In this system, this is possible that all the process may be in common ready queue or each processor may have its own private queue for the ready process.
对称多处理器(SMP)是第三个模型。 在此模型中,内存中只有一个OS副本,但是任何中央处理器都可以运行它。 现在,当进行系统调用时,在其上进行系统调用的中央处理单元将捕获到内核,然后处理该系统调用。 该模型平衡了进程和动态内存。 这种方法使用对称多处理,其中每个处理器都是自调度的。 通过让每个处理器的调度程序检查就绪队列并选择要执行的进程,进一步进行调度。 在此系统中,所有进程都可能在公共就绪队列中,或者每个处理器可能具有自己的专用队列以进行就绪过程。
There are mainly three sources of contention that can be found in a multiprocessor operating system.
在多处理器操作系统中,主要存在三种争用源。
Locking system
锁系统
As we know that the resources are shared in the multiprocessor system so there is a need to protect these resources for safe access among the multiple processors. The main purpose of locking scheme is to serialize access of the resources by the multiple processors.
众所周知,资源是在多处理器系统中共享的,因此需要保护这些资源,以便在多个处理器之间进行安全访问。 锁定方案的主要目的是序列化多个处理器对资源的访问。
Shared data
共享资料
When the multiple processor access the same data at the same time then there may be a chance of inconsistency of data so to protect this we have to use some protocols or locking scheme.
当多个处理器同时访问同一数据时,可能会出现数据不一致的情况,因此为了保护这一点,我们必须使用某些协议或锁定方案。
Cache coherence
缓存一致性
It is the shared resource data which is stored in the multiple local caches. Suppose there are two clients have a cached copy of memory and one client change the memory block and the other client could be left with invalid cache without notification of the change so this kind of conflict can be resolved by maintaining a coherence view of the data.
共享资源数据存储在多个本地缓存中。 假设有两个客户端具有缓存的内存副本,并且一个客户端更改了内存块,而另一个客户端可能在没有通知更改的情况下留有无效的缓存,因此可以通过维护数据的一致性视图来解决这种冲突。
翻译自: https://www.includehelp.com/operating-systems/multiprocessor-scheduling-in-operating-system.aspx
操作系统中的处理机调度调度