Operating System Structure
Summary
TLDRThis lecture delves into the structure of operating systems, emphasizing multiprogramming and multitasking. Multiprogramming allows the CPU to execute multiple programs, enhancing CPU utilization by ensuring it's always active. The concept is illustrated with a job pool and memory layout, demonstrating how jobs are managed for efficient CPU use. Multitasking, or time sharing, enables user interaction with running programs through rapid job switching, creating an illusion of a dedicated system for each user. The lecture highlights the importance of these features for efficient resource management and user experience in operating systems.
Takeaways
- 💡 Operating systems have a variety of internal structures but share common functionalities essential for their operation.
- 🔄 Multiprogramming is the capability of an operating system to run multiple programs concurrently, enhancing CPU utilization.
- 🤖 Without multiprogramming, a single user's task would monopolize the CPU and I/O devices until completion, leading to inefficiency.
- 🔑 A job pool is a collection of all tasks waiting to be executed, and a subset of these jobs is loaded into memory for execution.
- 🖥️ The operating system's role in multiprogramming is to assign the CPU to various jobs, ensuring that the CPU is never idle when a job is waiting for I/O operations.
- ⏱️ Multitasking or time sharing is an advancement over multiprogramming, allowing users to interact with programs while they are running by rapidly switching between them.
- 👥 Time-sharing systems support multiple users who can share the computer system simultaneously, giving the illusion of a dedicated system to each user.
- 🔄 The efficiency of time-sharing systems comes from the high-speed switching between user jobs, which is imperceptible to the users due to the difference in human and CPU speeds.
- 🤝 Direct communication between the user and the system is a key feature of time-sharing systems, unlike in multiprogramming.
- 📈 CPU scheduling algorithms play a critical role in time-sharing systems, determining how time is allocated among the users for their programs to execute.
- 💻 Each user in a time-sharing system has at least one program in memory, waiting to be executed, and once loaded and running, it is referred to as a process.
Q & A
What are the two fundamental capabilities that every operating system must have according to the lecture?
-Every operating system must be capable of multiprogramming and time sharing or multitasking.
What is the main purpose of multiprogramming in operating systems?
-The main purpose of multiprogramming is to increase CPU utilization by running multiple programs concurrently, ensuring that the CPU always has a job to execute.
How does multiprogramming improve CPU utilization?
-Multiprogramming improves CPU utilization by organizing jobs so that when one job is waiting for I/O operations or other resources, the CPU can switch to executing another job, thus avoiding idle time.
What is a job in the context of multiprogramming?
-A job in the context of multiprogramming is a unit of work that needs to be executed, which may contain code and data.
Can all jobs from the job pool be loaded into memory in a multiprogramming system?
-No, not all jobs from the job pool can be loaded into memory due to limited memory resources, such as RAM. Only a subset of jobs is loaded into memory at a time.
What is the difference between a multiprogramming system and a time-sharing or multitasking system?
-A multiprogramming system focuses on efficient use of system resources like CPU and memory but does not provide user interaction. In contrast, a time-sharing or multitasking system allows multiple users to interact with the computer system simultaneously, with the CPU switching rapidly between user jobs.
How does a time-sharing system provide the illusion of a dedicated system to each user?
-A time-sharing system provides the illusion of a dedicated system to each user by rapidly switching between user jobs, making the users feel that the entire system belongs to them, even though they are sharing the system with others.
What is the significance of CPU scheduling in a time-sharing system?
-CPU scheduling is significant in a time-sharing system as it determines how the CPU time is allocated among the various user jobs, ensuring that each user gets a fair share of the CPU resources.
What is the difference between CPU speed and human interaction speed in the context of a time-sharing system?
-CPU speed is significantly higher than human interaction speed. In a time-sharing system, the rapid switching of jobs occurs at CPU speed, while user interactions with the system occur at a slower human speed, creating a time gap that allows for efficient multitasking.
What is a process in the context of operating systems?
-A process is a program that has been loaded into memory and is currently executing. It represents an active instance of a program with its own resources and execution context.
How does the concept of multiprogramming relate to everyday life, as illustrated in the lecture with an example?
-The concept of multiprogramming relates to everyday life by drawing an analogy to a lawyer handling multiple clients. Just as a lawyer can work on one case and then switch to another while waiting for paperwork or trials, a CPU in a multiprogramming system can execute multiple jobs, switching between them to maximize efficiency.
Outlines
🖥️ Operating System Structure and Multiprogramming
This paragraph introduces the concept of operating system structure, emphasizing the importance of understanding computer system organization and architecture as a foundation. It highlights the internal differences among various operating systems like Windows and Ubuntu, while also noting their common functionalities. The main focus is on multiprogramming, which is the ability of an operating system to run multiple programs concurrently, thus improving CPU utilization. The paragraph explains how multiprogramming works by organizing jobs in a job pool and loading a subset into memory, allowing the CPU to execute different jobs when one job is waiting for I/O operations. This system prevents the CPU from being idle and ensures efficient use of computing resources.
🔄 The Efficiency of Multiprogramming and Transition to Multitasking
Building upon the concept of multiprogramming, this paragraph delves into its efficiency and relates it to real-life scenarios, such as a lawyer managing multiple clients simultaneously. It clarifies that while multiprogramming optimizes resource utilization, it lacks user interaction capabilities. The paragraph then transitions to the topic of multitasking or time-sharing systems, which allow for user interaction by rapidly switching between multiple jobs. It explains how a time-sharing system provides the illusion of a dedicated system to each user through fast job switching, facilitated by the high speed of CPU operations compared to human interaction speeds. The paragraph also sets the stage for further discussion on CPU scheduling algorithms and introduces the concept of a 'process' in the context of multitasking.
🕒 The Nature of Time-Shared Systems and CPU Scheduling
This paragraph further explores the characteristics of time-shared systems, illustrating how users perceive the system as if it were solely for their use, despite multiple users sharing the resources. It discusses the quick job-switching mechanism that occurs during the time gaps when users are slower in providing inputs compared to the system's processing speed. The paragraph underscores the importance of CPU scheduling in time-shared systems, which allocates a small portion of system time to each user, and mentions that each user has at least one program, known as a process, waiting in memory. The summary concludes with a note on the significance of the term 'process' in operating systems and an anticipation of future lectures on CPU scheduling and processes.
Mindmap
Keywords
💡Operating System
💡Multiprogramming
💡CPU Utilization
💡Job Pool
💡Memory Layout
💡Multitasking
💡Time Sharing
💡CPU Scheduling
💡Process
💡User Interaction
Highlights
Introduction to the operating system structure, focusing on multiprogramming and multitasking.
Differences in internal makeup of various operating systems like Windows and Ubuntu.
Common functionalities that every operating system must possess.
Definition and importance of multiprogramming in operating systems.
How multiprogramming increases CPU utilization by running multiple programs.
Explanation of job pool and memory layout in a multiprogramming system.
Concept of a job containing codes and data to be executed.
Limitations of memory and the selection of jobs to be loaded from the job pool.
Operating system's role in executing jobs by assigning CPU time.
Inefficiency of a system without multiprogramming, causing CPU idleness.
Efficiency of multiprogramming through job execution and CPU sharing.
Analogy of a lawyer managing multiple clients to explain multiprogramming.
Distinction between multiprogramming and time-sharing or multitasking systems.
Time-sharing system allowing user interaction with running programs.
The necessity of an interactive computer system for time-sharing.
Simultaneous sharing of the computer system among multiple users in time-sharing.
User perception of having exclusive access to the system in time-sharing.
CPU scheduling and its role in time-sharing systems.
Definition and importance of processes in operating systems.
Transcripts
In the previous lectures we have studied about
the basics of the operating system
and we have seen about computer system organizations
and computer system architecture.
Now, as we have the idea of computer system organizations and architecture,
We are now ready to talk about operating system structure.
So, in this lecture we will study the operating system structure,
and we will mainly talk about multiprogramming and multitasking.
So, operating systems vary greatly in their makeup internally.
So, we have different kinds of operating systems that we know already.
like Windows, Ubuntu and so on.
These operating systems vary in their makeup internally.
Internally the way they are made may be so much different.
But they also have so many common things between them.
We will see about the common things that every operating system
must be capable of doing.
So, we will be talking about the commonalities.
So, the first two things that every operating system
must be capable of doing are
multiprogramming and time sharing or multitasking.
So, these are two very important topics
which we will see in this lecture.
So, first let's talk about multiprogramming,
and then we will see multitasking, which is also known as time sharing.
So, coming to multiprogramming, from the name itself
we must have understood that
Multiprogramming means the capability of running
multiple programs by the CPU.
Now, a single user cannot,
in general, keep either the CPU
or the I/O devices busy at all the time.
Now, if you are not having multiprogramming,
what happens is that,
a single user will always keep the CPU or the I/O devices
busy at all the times.
That is because, when a single user wants to execute a particular task
he will use the CPU, so until and unless the task is completed
no other user can use the CPU or the I/O devices.
because it is not capable of multiprogramming.
But in multiprogramming what happens is that it increases the CPU utilization
by organizing the jobs which are codes and data
so that the CPU always has one to execute.
That means in multiprogramming, we are trying to increase our CPU utilization,
because the CPU is capable of executing multiple programs.
So let's see how this works.
In this diagram, we have the job pool
and the memory layout of the multiprogramming system.
So, first of all, let us understand what is a job.
So, a job is something that has to be executed,
which may contain codes and data.
So, here we have a job pool that consists of all the jobs that entered the system.
So, all the jobs that have to be executed are kept in a job pool like this.
and then here we have the memory layout of a multiprogramming system.
So, on top we have the operating system.
And, these are the jobs that are loaded into the memory.
So, we cannot load all the jobs of the job pool into the memory because
we don't have unlimited memory.
So, by memory I mean the main memory or the RAM.
So, here in this example, we are having 512 mega bytes of RAM.
So, you are not able to load all of these into the main memory.
So, a subset of these jobs or some of these jobs are loaded into the memory.
For example, we have loaded job one, two, three, and four into the memory.
Now, the operating system has to help in executing these jobs
by assigning the CPU to these particular jobs.
So, if we don't have this multiprogramming
what will happen is that,
let's say 'Job 1' starts executing and it is using the CPU.
Now, until 'Job 1' finishes its executions completely,
the other jobs can not use the CPU.
So, let's say that 'job 1' was using the CPU
and then it has to use resources in the course of its execution.
Let's say the I/O devices.
Now, when 'Job 1' goes to use the I/O devices,
the CPU is not used and it remains idle without being used by any other jobs.
So, that is a very inefficient way.
So, in multiprogramming, what happens is that,
let's take the same example again.
'Job1' starts executing and it is using the CPU.
And, on the course of its execution,
'job 1' tries to use the I/O devices.
So, when it goes for using I/O devices or any other resources,
the CPU is released from 'job 1'
and then that CPU, instead of remaining idle,
it can be used by another job, let' say 'jobs 2'
So, 'Job 2' can use the CPU, until 'Job1' finishes its other I/O devices operations
and wants the CPU back.
So, 'job 2' will use the CPU.
And, again if let's say 'job 2' wants to go for using some other resources
and does not need the CPU at a particular time
then instead of remaining idle, the CPU can be again used for 'Job 3' and so on.
So, we can see that, the CPU does not remain idle.
Whenever a particular job does not want to use the CPU,
the CPU can be utilized by another job.
So, this is a very efficient system or an efficient way of executing.
So, that is what multiprogramming is.
So, we see that, for an operating system to be efficient,
it should be capable of this multiprogramming.
So, we can also relate this multi programming with our day to day life.
So, let's say that for an example, there is a lawyer
who has different clients under him.
Now, the lawyer is not taking care of only a single client at a particular time.
let's say that, he is taking care of one client
and when that client case is waiting to go on a trial,
or when the lawyer is waiting for his paper work to be done,
he does not simply keep waiting for the single client
but at that same time, he can take care of another client that is under him.
So, in that way he is utilizing his time and resources efficiently.
So, that is what we do in multiprogramming.
We are trying to utilize our CPU efficiently.
Now, a multiprogrammed system provides an environment in which
the various system resources like CPU, memory, and peripheral devices
are used effectively, but they do not provide for user interaction
with the computer system.
So, the multiprogramming system
makes sure that all our resources are used effectively,
but it does not provide the user interaction with the computer system.
So, that brings us to the next topic, that is multitasking or time sharing system.
So, now let's see what is this time sharing or multi tasking system.
And, let us see how it is different from the multiprogramming system.
So, first of all, the CPU executes multiple jobs
by switching among them.
Now, this is almost same like the multiprogramming system.
The first point says that, the CPU execute multiple jobs.
We have multiple jobs, as we saw above.
And then, instead of executing only a single job at a time,
what the CPU does is
it switches between the jobs.
And then, the switching occurs so frequently that
the user can interact with
each program while it is running.
Now, the switching happens so quickly that
the user can interact with the program while it is running.
So, this was something that was not there in multiprogramming.
Here the user can actually interact with the program
even while it is running.
Because the switching between jobs takes places
very fast in this time sharing system.
This timesharing requires interactive and hands-on computer system,
which provides direct communication between the user and the system.
So, this was something that was not there in the multiprogramming system.
That was the last point that we discussed.
But in this time sharing system, there is a direct communication between
the user and the system.
And, in this time sharing system as the name suggests
a time-shared operating system allows
many users to share the computer simultaneously.
So, the computer system is shared among many users
simultaneously in this time sharing system.
So, let's see how this works.
So, in order to elaborate this point let us take an example.
Let's say we have a time shared system over here.
And there are four users sharing this system.
User one, two, three, and four.
They are sharing this time shared system.
Now, in this time sharing system,
the switching between the jobs of the users takes place so quickly that
the users themselves do not even realize that they are sharing the system.
They feel that the entire system belongs to just that person.
So, 'user 1' thinks that the entire system belongs to me.
And, user two, three, four, they all think the same.
Because the switching between the jobs takes place so quickly that
they don't even realize that
there is a time sharing, or multitasking is happening in this system.
Now, let's say that 'User 1' is using the time shared system,
and there is a certain job that he wants to execute.
So, the job is being executed by the time shared system.
And then the execution of the job takes place in CPU speed.
And, we know that CPU speed is very high.
So, the execution of the job takes place in CPU speed.
And, let's say that after execution
the user has to be shown some output,
And then the user has to give some input again to the system.
So, after the execution of the job
the output is shown to the 'User1'
And, 'user 1' wants to give some other input to the system,
that means he is interacting with the system.
Now the interaction between the user and the system
takes place in user's speed or people's speed.
that means it is taking place in human speed.
So, we know that CPU's speed is so much higher than a human speed.
So, when he gives an input to the system, he is giving in the normal human speed.
So, that time gap is itself is so big for the system that we have.
Because systems are very fast.
So, while he is giving input to the system, in the time gap
the CPU can be used by 'user 2' for executing the job.
So, in that way we see that,
there is a time gap between the user and the system,
because users are usually slower than the system.
So, in that time gap,
the switching of the jobs takes place so quickly,
and it is so quick and so frequent that
the user does not even realize that they are using a time shared system.
They just feel like that the entire system belongs to themselves.
So, the time shared system uses CPU scheduling and multiprogramming
to provide each user with a small portion of time shared computer.
So, as I told you,
a small portion of the time shared system is provided to each of the user.
But the user thinks that the entire system belongs to him.
How this time will be shared among the users
that will be decided using CPU scheduling algorithms,
which we will discuss in detail in the coming lectures.
So, this is a very important topic CPU scheduling,
which we will discuss later on.
And, then each user has at least one separate program in memory.
So, all of these users, they at least have one of the programs
waiting in memory to be executed.
And then, a program loaded into the memory
and executing is called a process.
Now, as I told you
each of this user have programs stored in memory
which are waiting to be executed
and when a particular program is loaded into the memory
and when it is executing
that program is known as a process.
Now, this is a very important term
as far as the subject operating system is concerned.
'Process', so keep this word in mind.
And we will be discussing this in later and in more detail in the coming lectures.
So, for now this is all we have discussed,
about multiprogramming and multitasking or time shared systems.
So, I hope this was clear to you.
Thank you for watching and see you in the next one.
تصفح المزيد من مقاطع الفيديو ذات الصلة
L-5.1: Memory Management and Degree of Multiprogramming | Operating System
CONCURRENCY IS NOT WHAT YOU THINK
Difference between Multitasking, Multiprogramming and Multiprocessing | Operating system | CSE
What is a Process in an Operating System?
47. CAMBRIDGE IGCSE (0478-0984) 4.1 Operating systems - Part 1
39. OCR GCSE (J277) 1.5 Operating systems 1
5.0 / 5 (0 votes)