操作系统中的处理机_操作系统中的多程序和多处理

操作系统中的处理机

什么是多程序操作系统? (What is Multiprogramming Operating System?)

To overcome the problem of underutilization of CPU and RAM, the concept of multiprogramming was introduced.

为了克服CPU和RAM使用不足的问题,引入了多程序设计的概念。

"In a multiprogramming system, two or more processes execute one after another or more different independent programs by the same computer system."

“在一个多程序系统中,两个或多个进程由同一计算机系统一个接一个地执行另一个或多个不同的独立程序。”

Working of Multiprogramming System

多程序系统的工作

  • In this concept, two or more user programs can be in main memory and can be executed concurrently. The CPU can give time to various programs despite sitting idle when one is busy with I/O operations.

    在此概念中,两个或更多个用户程序可以位于主存储器中,并且可以同时执行。 尽管在I / O操作繁忙时CPU处于空闲状态,但它仍可以给各种程序分配时间。

  • When one program is waiting for I/O transfer there is next program ready to utilize the processor. Therefore, several processes can share the time of the CPU.

    当一个程序正在等待I / O传输时,下一个程序就可以使用处理器了。 因此,几个进程可以共享CPU的时间。

  • Execution of jobs at the same instance of time is not referred to as multiprogramming but it is defined as the number of jobs available to the processor (placed in main memory) and a portion of another process is executed then a segment of another and so on.

    在同一时间实例中执行作业不称为多程序,而是定义为处理器可用的作业数(放置在主存储器中),执行另一个进程的一部分,然后执行另一个进程的一部分,依此类推。

A process of multiprogramming is shown in figure:

多重编程的过程如图所示:

multipogramming in OS

Why use Multiprogramming OS?

为什么要使用Multiprogramming OS?

  • Increased Throughput - Throughput is increased by utilizing the idle time of the CPU by running other programs also that are already available in the main memory.

    增加的吞吐量 -通过运行主存储器中已经可用的其他程序来利用CPU的空闲时间来增加吞吐量

  • Lowered Response Time - Response Time is lowered by identifying the priority of a job as it enters in the system and by executing jobs on behalf of their priority.

    降低响应时间 -通过识别作业进入系统时的优先级并代表其优先级执行作业来降低响应时间

Drawbacks of Multiprogramming OS

多程序操作系统的缺点

  • User cannot interact with any program while that is in execution. So, we have to perform offline debugging.

    在执行过程中,用户无法与任何程序交互。 因此,我们必须执行离线调试。

  • CPU scheduling and memory management are required.

    需要CPU调度和内存管理。

什么是多处理操作系统? (What is Multiprocessing Operating System?)

These types operating system has multiple processors within a single Computer system which shares their bus, clock, memory and input/output devices. By using Input/ Output processors enhance the efficiency of the computer system and it makes possible the concurrent execution of input, processing and output operations.

这些类型的操作系统在单个计算机系统中具有多个处理器,这些处理器共享它们的总线,时钟,内存和输入/输出设备。 通过使用输入/输出处理器,可以提高计算机系统的效率,并可以同时执行输入,处理和输出操作。

multiprocessing in OS

Basic Organization of a typical Multiprocessing System

典型的多处理系统的基本组织

Working of Multiprocessing System

多处理系统的工作

  • In multiprocessing systems, many processes can be executed simultaneously. Say processes P1, P2, P3, and P4 are waiting for their execution. In the uni-processor system, one process will execute, then the next one, then the other and so on.

    在多处理系统中,许多过程可以同时执行。 说进程P1,P2,P3和P4正在等待执行。 在单处理器系统中,将执行一个进程,然后执行下一个进程,然后执行另一个进程,依此类推。

  • In multiprocessing, each process can be allocated to a different processor for its execution. If its a dual-core processor (2 processors), two processes can be executed simultaneously and thus it will be two times faster, similarly a quad-core processor(4 processors) will be four times as fast as a single processor.

    在多处理中,每个进程可以分配给不同的处理器以执行。 如果它是双核处理器(2个处理器),则可以同时执行两个进程,因此速度将提高两倍,类似地,四核处理器(4个处理器)的速度将是单个处理器的四倍。

  • In some systems, various small CPUs are connected to perform the main processing. If one of the small CPUs fails, the other CPUs will automatically start executing its job. In other systems, CPUs are connected as a computer network.

    在某些系统中,连接了各种小型CPU以执行主要处理。 如果其中一个小型CPU发生故障,其他CPU将自动开始执行其作业。 在其他系统中,CPU作为计算机网络连接。

Why use Multiprocessing OS?

为什么要使用多处理操作系统?

  • By permitting parallel processing of different portions of programs, enhances the performance of the computer systems.

    通过允许并行处理程序的不同部分,可以增强计算机系统的性能。

  • In addition to the CPUs, it also facilitates the more effective utilization of other devices that saves money.

    除了CPU外,它还有助于更有效地利用其他设备,从而节省了资金。

  • Multiprocessing provides the facility of built-in backup. If one of the CPUs breaks down, the other CPUs automatically controls the complete workload until repairs are made. Thus, a complete breakdown of such a system is very rare, so that reliability of system increase.

    多重处理提供了内置备份的功能。 如果其中一个CPU发生故障,则其他CPU自动控制整个工作负载,直到进行维修为止。 因此,这种系统的完全故障是非常罕见的,从而提高了系统的可靠性。

Drawbacks of Multiprocessing OS

多处理操作系统的缺点

  • A good performance OS required to schedule, balance and coordinate the input, output and processing activities of multiple CPUs. To build such type of OS it requires a large amount of time and highly powered computer working people.

    计划,平衡和协调多个CPU的输入,输出和处理活动所需的高性能OS。 要构建这种类型的OS,需要大量的时间和功能强大的计算机工作人员。

  • It is very expensive.

    这非常贵。

  • The main memory of bigger size is required for holding the special OS along with various users programs.

    为了容纳特殊的OS和各种用户程序,需要更大容量的主存储器。

多重编程和多重处理操作系统之间的区别 (Difference between Multi programming and Multi processing OS)

  • Multiprogramming is interleaved execution of two or more process by a single CPU computer system. Whereas, Multiprocessing is the simultaneous execution of two or more process by a computer having more than one CPU.

    多重编程是指单个CPU计算机系统交错执行两个或多个过程。 而“ 多处理”是指具有一个以上CPU的计算机同时执行两个或多个进程。

  • Multiprogramming occurs by switching from one process to others (a phenomenon called context switching) whereas, Multiprocessing occurs by means of parallel processing.

    通过多道通过并行处理的装置从一个过程到其它(这种现象称为上下文切换),而, 多处理发生交换发生。

  • Multiprogramming includes executing a portion of the program, then a segment of another in the consecutive time period. But in Multiprocessing it is possible for a system to simultaneously work on several program segments of one or more program.

    多重编程包括在连续时间段内执行程序的一部分,然后执行另一段。 但是在多处理中 ,系统可以同时处理一个或多个程序的多个程序段。

  • In Multiprogramming context switching takes place but multiprocessing permits parallel processing.

    多程序上下文中,发生了切换,但是多处理允许并行处理。

翻译自: https://www.includehelp.com/operating-systems/multiprogramming-and-multiprocessing.aspx

操作系统中的处理机

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值