Hello friends, Welcome to Gate Smashers In types of operating system These two types are very important That's multi-tasking, multi-program or time-sharing operating system Here, students get confused many times that what is actually multi-programmed and what is multitasking, also, what's the difference between both of them So first I'm telling about multi-programmed The concept of a multi-programmed operating system came first, in which we were supposed to bring as many processes as possible That's only the meaning of the multi-program As I'm showing in the diagram that if I've RAM of limited size definitely We are bringing multiple processes in the RAM Now it's an important point that how execution of these processes takes place I mean how do we schedule them In multi-programmed its actually generally non pre-emptive What non pre-emptive means is that if I bring out P1 from the RAM and gave to CPU then CPU will execute P1 completely then it'll proceed to P2, P3 or P4 So the advantage that I've here is, that CPU's idle time is decreasing, means CPU will not stay free CPU stays free when I give P1 to CPU many times what happens is that we have variety of instructions in processes What happens in those instructions is many time process say to access some input-output operation like It want to access some device or file Then what happens is that process reaches to Input-output operation So that time CPU will be free?... NO At that time we'll give some other process to CPU means we have already abundance no. of processes available so that if a process will leave from the CPU, then we'll give some other process to CPU But the important point here is that if CPU will execute a process then it'll execute it completely, until or unless process will say on its own that it want to go for some input-output operation Then it'll allow for input output operation I mean to say is, Let me take a simple example let's say there're 10 students sitting in a class And every student have 5 questions to solve Now if I'm there as a CPU So if we'll see the concept of multi-programmed then what we have done is We've placed 10 students in the first class and everyone have 5 questions Now I reached to student1 and will execute its all 5 questions And then I'll go to next process That's an important point... Now if in between process is saying to leave for some reason Then it can go... and the CPU will switch to P2 That's only the case.. . But if the student is not saying anything then I'll solve its all 5 questions and then will go to student2 Then all 5 questions of student2 and then proceed to student3 That's the important point of multi-program But multi-tasking is pre-emptive What pre-emptive or time sharing means is That we decided it in advance that I'll execute a process for sometime If it got executed under that time interval then well and good otherwise I'll schedule it again in future Means to say is... Let's take the student example again, everyone have 5 questions I reached to Student1 and I've already decided that I'll solve only two questions Means I solved question1 and question2 and reached to student2 Student1 is still there not saying anything But I pre-empted to student2 by my own and solved its question 1&2 and then pre-empted to student3, again solved its question 1&2 and moved to student 4 if you are thinking what's the advantage here Obviously there's no Idleness here also Because CPU have processes available all the time to execute, so Idleness will be very low here But another advantage we've here is, Response time Response time means, if you'll see in multi programmed then I'll solve 5 questions of 1st, then 2nd, then 3rd... Means all questions at once then 10th student's turn will come very late Means i'm giving response after so much time But in time sharing, I'll solve 2 questions of first even if it have 5 questions but still I'll solve just two Then 2 for Student2, then 2 for student3 and so on And this way I'll reach to the 10th student faster Means I'm creating the response faster Then I'll go back again to student1 And will solve question 3&4 of all of them Then again I'll go back to student1 and will solve question 5 if everyone Means I'll solve all questions like that Means what time sharing and multi-tasking means is CPU is executing P1 process for some time then will preempt to p2, then P3, then P4 That's an important point, so what's the advantage I'm getting here?... Responsiveness Means it's giving more emphasis on response time But it's giving more emphasis on Idle That CPU should not be Idle Means CPU should be Idle as less as possible That's an important point and important difference between multi programmed operating system and multi-tasking or multi sharing So the system that we use in real time is actually the one that we use in our laptop is multi-tasking or time sharing There we use a lot of algorithms like one of them is round robin You can get videos on it where I've solved round robin that how it executes different processes So that's a different point that how we execute processes and what's the way But in this video we just have to see the difference between them That what is multi program and how it's different from the multi-tasking Thank You!