操作系统中的处理机调度调度_操作系统中的多处理器调度
操作系統(tǒng)中的處理機(jī)調(diào)度調(diào)度
多處理器操作系統(tǒng) (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.
多處理器系統(tǒng)由幾個(gè)共享內(nèi)存的處理器組成。 在多處理器中,系統(tǒng)中有多個(gè)處理器。 我們使用多處理器的原因是,有時(shí)處理器上的負(fù)載很高,但是不需要其他功能上的輸入輸出。 這種類型的操作系統(tǒng)更加可靠,即使在處理器出現(xiàn)故障時(shí),其他操作系統(tǒng)仍然可以繼續(xù)工作。 該系統(tǒng)相對(duì)便宜,因?yàn)槲覀冎粨碛刑幚砥鞯母北?#xff0c;但其他設(shè)備(如輸入輸出和內(nèi)存)是共享的。 在多處理器系統(tǒng)中,所有處理器都在單個(gè)操作系統(tǒng)下運(yùn)行。 處理器的多樣性以及處理器如何協(xié)同工作對(duì)彼此透明。
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.
在這種情況下,用戶不知道其處理在哪個(gè)處理器中進(jìn)行。 一個(gè)進(jìn)程分為幾個(gè)小進(jìn)程,它們?cè)诓煌奶幚砥魃溪?dú)立工作。 一個(gè)系統(tǒng)可以通過(guò)同時(shí)運(yùn)行多個(gè)程序來(lái)進(jìn)行多程序編程,也可以通過(guò)擁有多個(gè)物理和處理器來(lái)進(jìn)行多處理。
In this diagram, there are more than 1 CPU and they shared a common memory.
在此圖中,有1個(gè)以上的CPU,它們共享一個(gè)公共內(nèi)存。
.minHeight{min-height: 250px;}@media (min-width: 1025px){.minHeight{min-height: 90px;}} .minHeight{min-height: 250px;}@media (min-width: 1025px){.minHeight{min-height: 90px;}}多處理調(diào)度 (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.
在多處理器調(diào)度中,有多個(gè)CPU共享負(fù)載,因此各種進(jìn)程可以同時(shí)運(yùn)行。 通常,與單處理器調(diào)度相比,多處理器調(diào)度比較復(fù)雜。 在多處理器調(diào)度中,有許多處理器,它們是相同的,我們可以隨時(shí)運(yùn)行任何進(jìn)程。
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.
系統(tǒng)中的多個(gè)CPU處于緊密通信中,共享一個(gè)公共總線,內(nèi)存和其他外圍設(shè)備。 因此,我們可以說(shuō)該系統(tǒng)是緊密耦合的系統(tǒng)。 當(dāng)我們要處理大量數(shù)據(jù)時(shí),將使用這些系統(tǒng)。 這些系統(tǒng)主要用于衛(wèi)星,天氣預(yù)報(bào)等。
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.
多處理系統(tǒng)致力于對(duì)稱多處理模型的概念。 在此系統(tǒng)中,每個(gè)處理器都在操作系統(tǒng)的相同副本上工作,并且這些副本彼此通信。 我們借助該系統(tǒng)可以節(jié)省其他設(shè)備(例如外圍設(shè)備)的費(fèi)用。 電源和其他設(shè)備是共享的。 最重要的是,我們可以在短時(shí)間內(nèi)完成更多工作。 如果一個(gè)系統(tǒng)在多處理器系統(tǒng)中發(fā)生故障,則整個(gè)系統(tǒng)將不會(huì)停止運(yùn)行,而只會(huì)降低處理器的速度。 多處理系統(tǒng)的整體性能由操作系統(tǒng)管理。 操作系統(tǒng)將不同的任務(wù)分配給系統(tǒng)中的不同處理器。 在多處理系統(tǒng)中,進(jìn)程分為多個(gè)線程,它們可以獨(dú)立運(yùn)行。 這些類型的系統(tǒng)允許線程同時(shí)在多個(gè)處理器上運(yùn)行。 在這些系統(tǒng)中,各種并行處理因此稱為并行處理器。 并行處理是CPU同時(shí)運(yùn)行各種進(jìn)程的能力。 在多處理系統(tǒng)中,各個(gè)處理器之間動(dòng)態(tài)地共享資源。
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.
多處理器操作系統(tǒng)是一種常規(guī)OS,可同時(shí)處理多個(gè)系統(tǒng)調(diào)用,執(zhí)行內(nèi)存管理,還提供文件管理以及輸入輸出設(shè)備。
There are some extra features which multiprocessor perform:
多處理器還具有一些額外的功能:
Process synchronization
流程同步
Resource management
資源管理
Scheduling
排程
There are various organizations of multiprocessor operating system:
多處理器操作系統(tǒng)有多種組織:
1.每個(gè)CPU都有自己的操作系統(tǒng) (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.
在這種類型的組織中,系統(tǒng)中有許多中央處理單元,每個(gè)CPU都有自己的專用操作系統(tǒng),并且所有處理器之間共享內(nèi)存,并且輸入輸出系統(tǒng)也共享。 所有系統(tǒng)通過(guò)單條總線連接。
.minHeight{min-height: 250px;}@media (min-width: 1025px){.minHeight{min-height: 90px;}} .minHeight{min-height: 250px;}@media (min-width: 1025px){.minHeight{min-height: 90px;}}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.
在這種類型的多處理器模型中,只有一個(gè)數(shù)據(jù)結(jié)構(gòu)可以跟蹤就緒的進(jìn)程。 在此模型中,一個(gè)中央處理單元充當(dāng)主控,另一個(gè)中央處理單元充當(dāng)從屬。 在這種情況下,所有處理器均由稱為主服務(wù)器的單個(gè)處理器處理。 主服務(wù)器運(yùn)行操作系統(tǒng)進(jìn)程,而從服務(wù)器運(yùn)行用戶進(jìn)程。 存儲(chǔ)器和輸入輸出設(shè)備在所有處理器之間共享,并且所有處理器都連接到公共總線。 該系統(tǒng)非常簡(jiǎn)單,減少了數(shù)據(jù)共享,因此該系統(tǒng)稱為非對(duì)稱多處理 。
3.對(duì)稱多處理器 (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.
對(duì)稱多處理器(SMP)是第三個(gè)模型。 在此模型中,內(nèi)存中只有一個(gè)OS副本,但是任何中央處理器都可以運(yùn)行它。 現(xiàn)在,當(dāng)進(jìn)行系統(tǒng)調(diào)用時(shí),在其上進(jìn)行系統(tǒng)調(diào)用的中央處理單元將捕獲到內(nèi)核,然后處理該系統(tǒng)調(diào)用。 該模型平衡了進(jìn)程和動(dòng)態(tài)內(nèi)存。 這種方法使用對(duì)稱多處理,其中每個(gè)處理器都是自調(diào)度的。 通過(guò)讓每個(gè)處理器的調(diào)度程序檢查就緒隊(duì)列并選擇要執(zhí)行的進(jìn)程,進(jìn)一步進(jìn)行調(diào)度。 在此系統(tǒng)中,所有進(jìn)程都可能在公共就緒隊(duì)列中,或者每個(gè)處理器可能具有自己的專用隊(duì)列以進(jìn)行就緒過(guò)程。
There are mainly three sources of contention that can be found in a multiprocessor operating system.
在多處理器操作系統(tǒng)中,主要存在三種爭(zhēng)用源。
Locking system
鎖系統(tǒng)
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.
眾所周知,資源是在多處理器系統(tǒng)中共享的,因此需要保護(hù)這些資源,以便在多個(gè)處理器之間進(jìn)行安全訪問(wèn)。 鎖定方案的主要目的是序列化多個(gè)處理器對(duì)資源的訪問(wèn)。
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.
當(dāng)多個(gè)處理器同時(shí)訪問(wèn)同一數(shù)據(jù)時(shí),可能會(huì)出現(xiàn)數(shù)據(jù)不一致的情況,因此為了保護(hù)這一點(diǎn),我們必須使用某些協(xié)議或鎖定方案。
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.
共享資源數(shù)據(jù)存儲(chǔ)在多個(gè)本地緩存中。 假設(shè)有兩個(gè)客戶端具有緩存的內(nèi)存副本,并且一個(gè)客戶端更改了內(nèi)存塊,而另一個(gè)客戶端可能在沒(méi)有通知更改的情況下留有無(wú)效的緩存,因此可以通過(guò)維護(hù)數(shù)據(jù)的一致性視圖來(lái)解決這種沖突。
翻譯自: https://www.includehelp.com/operating-systems/multiprocessor-scheduling-in-operating-system.aspx
操作系統(tǒng)中的處理機(jī)調(diào)度調(diào)度
總結(jié)
以上是生活随笔為你收集整理的操作系统中的处理机调度调度_操作系统中的多处理器调度的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: html 图片上放置按钮,用CSS在图片
- 下一篇: gdb ldexp_带有Python示例