操作系統中的處理機調度調度
多處理器操作系統 (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
操作系統中的處理機調度調度