0% found this document useful (0 votes)
6 views4 pages

OS CHP1 - Multiprogramming Operating System

Uploaded by

Deeksha Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

OS CHP1 - Multiprogramming Operating System

Uploaded by

Deeksha Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

LECTURE NOTES

on
OPERATING SYSTEM
(ICS-401)

2023 – 2024

B. Tech IIIrd Sem e s t e r


Mr. Deepanshu Singh Yadav, Assistant Profes so r
Ms. Diksha Sharma, Assistant Profes so r

Sitapur Road, Lucknow


Uttar Pradesh
India
Pin Code :226021

INSTITUTE OF ENGINEERING
&TECHNOLOGY

Department of Computer Science and Engineering

Mr. Deepanshu Singh Yadav , Assistant Professor ,IET,LUCKNOW Page 1


Ms.Diksha Sharma, Assistant Professor ,IET,LUCKNOW
REFERENCES :
1. Silberschatz, Galvin and Gagne, “Operating Systems Concepts”, Wiley
2. Harvey M Dietel, “ An Introduction to Operating System”, Pearson Education
3. William Stallings, “Operating Systems: Internals and Design Principles ”, 6th Edition, Pearson
Education
4. D M Dhamdhere, “Operating Systems : A Concept based Approach”, 2nd Edition
5. Sibsankar Halder and Alex A Aravind, “Operating Systems”, Pearson Education
6. Rajiv Chopra, “ Operating System a Practical approach”, S.Chand
7. I.A.Dhotre, “Operating System”,Technical Publications.
8. codeforwin.org/
9. https://www.prepbytes.com/
10. Tutorials point

Disclaimer: The e-content is exclusively meant for academic purposes and for enhancing teaching and
learning. Any other use for economic/commercial purpose is strictly prohibited. The users of the content shall
not distribute, disseminate or share it with anyone else and its use is restricted to advancement of individual
knowledge. The information provided in this e-content is developed from authentic references, to the best of
my knowledge.

Mr. Deepanshu Singh Yadav , Assistant Professor ,IET,LUCKNOW Page 1


Ms.Diksha Sharma, Assistant Professor ,IET,LUCKNOW
Multiprogramming Operating System?
A multiprogramming operating system is a type of operating system that allows multiple programs to run
simultaneously on a single CPU. This is achieved by allocating CPU time to different programs in such a way
that it appears that they are all running simultaneously. The operating system manages the resources, such as
memory and input/output devices, for each program to ensure that they all run efficiently without interfering
with each other. Multiprogramming operating systems are designed to make efficient use of system resources
and to improve system throughput by allowing multiple programs to execute concurrently.
In other words, Multiprogrsmming is a technique to execute number of programs simultaneously by
a pmce«or. Buffertng and spooling improve system performance by over lapptng the input, and
alw
computation of a stngle job, both have their limitations. A single user cannot avs CPU or 10 devices his-
y at all times. So, multiprogramming offers a more efficient approach to incrase the system performance.
To increase the resource utilization, systems this multiprogramming approach, allow more than
ti
one job (program) to utilize CPU me at any Please note here that more the number of programs competing
for resources better will be the resource udlizadon.
The basic idea is implana'lted as follows. The main memory of the system contams more thal one
program as in Fig. 1.3.

The OS could support for keeping several jobs in the memory at one time. The OS could pick and start
the execution of one of the jobs in the memory. Wthenever the jobs does not need CPU (i.e. the job has to do
I/O only) and so the CPU is idle at that time then the OS to anotha job in the memory and CPU executes a
portion of it till this job issues a rquest for I/O or the first one has finished its I/O and so on.
Ixt us consider an example, say, there are two programs, PI and Pi that are residing in the main memory.
The OS picks one of the programs and start executing it. During execution, say PI eeds some 100 operations
to complete. Then, what happens in a sequential environment is that the CPU would sit idle i.e., see Figure
1.4 (a)
idle state

Program — 1 Program 2
Fig. 1.4 (a) Sequential execution of PI and P2
On the other hand, in a multiprogramming system, the OS will simply switch over to the next program

Mr. Deepanshu Singh Yadav , Assistant Professor ,IET,LUCKNOW


Page 1
Ms.Diksha Sharma, Assistant Professor ,IET,LUCKNOW
(P2). This is shown in Figure 1.4 (b) below—

Fig. 4 (b) Execution of PI and P2 in a multiprogamming environment


If PI is busy with some I/O then it switches to P2. Similarly, ifP2 wants to do some I/O then it switches
to Py This goes on. Please note here that if there is no other program after P3 (say) then the CPU will pass its
control back to the previous programs.
Another point to note here is that the OS in this case had to be very complex in the sense that now more
serious memory management is required. Switching from one job to another is also not very easy.
o The concurrent residency of more than one program in the main memory is referred as
multiprogramming."
o Since multiple programs are resident in the memory, as soon as the currently executing program
finishes its execution, the next program is dispatched for its consumption.
o Also if the currently executing program asks for input output resources then meanwhile another
program is dispatched to the CPU for execution.
o The main objective of multiprogramming is:
o Maximum CPU utilization.
o Efficient management of the main memory.

Working of Multiprogramming Operating System


A real-life scenario that can help explain the working of a multiprogramming operating system is a modern
desktop computer. When a user turns on their computer, the operating system (such as Windows, macOS, or
Linux) loads and initializes various components such as the CPU, memory, and input/output devices.
As the user begins to open applications and run programs, the operating system allocates CPU time and
memory to each process, ensuring that each program has the resources it needs to execute properly. For
example, the user may open a web browser to browse the internet, a media player to watch videos or listen to
music, and a word processor to write a document.
As the user interacts with each program, the operating system manages input/output operations for each
process, allowing multiple programs to use I/O devices such as the keyboard, mouse, and monitor
simultaneously without conflicts. For example, the user may be typing in a word processor while also scrolling
through a web page in the browser, and playing music in the background through the media player.
The operating system also manages interrupts, which can be triggered by various events such as hardware
failure or software error. For example, if the user’s printer encounters a paper jam, an interrupt may be
triggered to alert the operating system to the problem.
There are

Mr. Deepanshu Singh Yadav , Assistant Professor ,IET,LUCKNOW


Page 1
Ms.Diksha Sharma, Assistant Professor ,IET,LUCKNOW

You might also like