Thumbnail for null by null

6m 39s905 words~5 min read
Auto-Generated

[0:00]Hello guys, welcome you all to my channel making IT simple. In previous videos we saw about operating system and batch operating system, which is a type of operating system. You can find it here if you have not watched it yet. And also there are links in description. Today in this video we are going to learn about one more type of operating system which is multiprogramming operating system. Without wasting any time let's start the video.

[0:41]So first let's take a look at the definition. In a multi-programming system, two or more user programs can be in memory and are executed one after another. So before simplifying the definition, let us see what was the reason for multiprogramming operating system. As we have seen in previous video, early operating systems would execute one program at a time. One program was loaded into the RAM, that is main memory and the CPU would execute it. Until the program is executed completely, no other program was executed. The problem behind this was, when a program required some input output operation or some other operation or it requires to access some file. It would move out of the CPU for that particular operation. So when that would happen, CPU remained idle and CPU utilization was very low.

[1:44]So now we will see how multiprogramming operating system works and how multiprogramming operating system overcame the CPU utilization problem. In multiprogramming operating system, multiple programs or processes which are to be executed are loaded into the main memory. Operating system will then assign the process P1 to the CPU. The CPU will start execution of P1. CPU will complete the execution of P1 completely and then go to process P2 unless P1 is interrupted by external factor or it goes for input output operation. If P1 is interrupted then operating system assigns next job say P2 to the CPU. The CPU then starts execution on P2. Whenever the P1 completes its operation and comes back for execution, CPU is allocated for that process and then P1 is executed. And then other processes are executed one by one in same fashion.

[2:47]Let us consider a real life example, let's say you are a school teacher and you need to take oral exam of students as per their roll numbers which contains 10 questions. You start with first student, ask all 10 questions and then move on to the second one. You ask five questions and student asks you for a washroom break, you give him permission and he leaves. Now time is important for you and you can't waste any time as you need to complete the exams for whole class. So you move on to the third student and start his or her 10 questions. When the previous student returns you complete his remaining five questions. Then move on to the fourth and so on. Same is done in multiprogramming operating system, CPU does not remain idle, it will be in working state every time until there is no process for execution. Let's see with a proper example, let us consider there are three processes. First operating system will allocate CPU for process one, CPU will start the execution. Let's say P1 does not require to go out for any operation, so CPU will execute P1 completely. As P1 is executed it will be removed from the main memory. Now operating system will allocate CPU for process two, CPU will start its execution. Let's say P2 requires some input output operation, the CPU will stop the execution for P2. P2 will go out of CPU for the operation. Now the CPU will not wait for P2 to finish its operation. Operating system will allocate process 3 to the CPU and CPU will start the execution on P3 and will execute P3 until P2 comes back. Once P2 comes back it will stop execution of P3 and start executing P2 and after executing P2 completely, it will go for P3 and execute P3 completely. This way, CPU never remains idle until it completes all processes. And this is how multiprogramming works and overcomes the problem of low CPU utilization.

[5:06]The problem which we faced in previous operating system that CPU remains idle for long time and is underutilized, this problem is solved in multiprogramming operating system. CPU never remains idle and is completely utilized. The ultimate goal of multiprogramming operating system is to keep CPU busy as long as there are processes waiting for execution. Let's see the advantages and disadvantages of multiprogramming operating system. Advantages are as following. First is CPU utilization is maximum and CPU never remains idle. Second is short time jobs are executed faster. Third is resources are used efficiently. Fourth is response time is shorter. Disadvantages are following. First is it is difficult to program a system because of complicated schedule handling. Second is due to high load of tasks, long time jobs have to wait long.

[6:10]In this video we saw how a multiprogramming operating system works and how it overcame the disadvantages which were present in previous operating system. If you have any doubts or queries or suggestions comment them down below. If you loved the video and got to learn anything from this like the video and share it with your friends or classmates or batchmates. Subscribe my channel and press the bell icon for more such fun and interesting videos.

Need another transcript?

Paste any YouTube URL to get a clean transcript in seconds.

Get a Transcript