Multiprogramming is the
interleaved execution of two or more different
and independent programs by the same computer. The goal of the multiprogramming
is to improve the system utilization by exploiting the concurrency between the
CPU and the I/O sub-system. The basic idea of multiprogramming is that while
I/O sub-system is busy with an I/O operation for one user job, the CPU can
execute another job. This requires the presence of multiple user jobs
simultaneously in the computer’s memory that are ready to utilize the CPU.
Thus,
while one program is waiting for I/O transfer, the CPU is given to another
program in the memory, which is ready to utilize it. In multiprogramming, all
the programs residing in the memory will be in one of the following states: Running,
Blocked and Ready. Process states will discuss later.
To increase the resource utilization, multiprogramming
systems usually allow more than two programs to compete for the system
resources at any time. The number of programs actively competing for system
resources of a multiprogramming system is called the degree of multiprogramming. In principle, higher the degree of
multiprogramming should results in higher resource utilization.
Incorporation of multiprogramming in a system
requires the following additional hardware and software features:
· Large memory: To occupy multiple jobs at a time.
· Memory protection: To prevent a program in one memory partition from
changing information or instructions of a program in another memory partition.
· Program status prevention: before a program is suspended and control is
passed to another program, the values of all the CPU registers should be stored
in the memory area of that program and then restored when the control is
returned to the that program. This is known as Program Status Prevention.
· Proper job mix: Proper mix of I/O bound and CPU-bound jobs are required
to effectively overlap the operations of the CPU and I/O devices. At least one
of the programs, which does not need I/O, is always available to the CPU for
processing.
Types of
Multiprogramming Systems
·
Cooperative multitasking
·
Preemptive multitasking
·
Multithreading and
·
Multiprocessing system
NEXT: Time-sharing OS
Previous: Batch processing OS
Index : Operating System
what is the difference between multitasking and multiprogramming?
ReplyDeleteAn operating system capable of simultaneously executing multiple programs is a multitasking system, but there is a significant difference between several tasks running in an application versus several processes running an operating system. All processes own individual memory space, one process cannot access memory space of another process (except when memory sharing). Each process inherits many system resources, such as input and output stream, environment variables, and so on. Where multiple tasks share the same memory and resources and run inside a single process.
DeleteIt is infact an older concept. Both the concepts work exactly using the same principle. However, the difference is just like a program and its multiple thread. In multiprogramming there will be only single thread and therefore it will be an independent program with memory and other resources. The multitasking concept came as a modification of this pure multiprogramming for better resource sharing. In multitasking, the independent tasks (an older concept of modern threads) of a program are executed in a multiprogramming fashion for parallel execution, but remember that the tasks will share the same memory area of the program and often may need to synchronize with other tasks in the program. In short, it is an older implementation of modern threads (currently only has historical importance).
DeleteI think you got an idea about "what is the difference between multiprogramming and multitasking?"
DeleteThe second says that multiprogramming means running several programs at the same time in an interleaved manner and multitasking is an extension of this concept.In multitasking the switching between jobs occurs so frequently that the users can interact with each program while it is running while in multiprogramming the user may not be able to interact with the programs easily.
ReplyDeleteYou have given me yet another answer. Which is correct? Can u check out and let me know.
http://wiki.answers.com/Q/What_is_the_difference_between_multitasking_multiprogramming_and_multiprocessing
Deletemultiprogramming operating systems are not suitable for interactive type applications where the user directly interacts with the computer system.
DeletePS : There was yet another distinction. According to it when multiple users are involved it is multiprogramming and when only a single user is involved it is multitasking. However, what are being interleaved are processes and not threads.
ReplyDeleteThe following links may help you to get correct answer
Deletehttp://books.google.co.in/books?id=YwZYZbsl2GEC&pg=PA415&dq=difference+between+multiprogramming+and+multitasking&hl=en&sa=X&ei=7FwoUde8C8irrAeLkIHgCQ&ved=0CEEQ6AEwAw#v=onepage&q=difference%20between%20multiprogramming%20and%20multitasking&f=true
http://books.google.co.in/books?id=lzwEAAAAMBAJ&pg=PA78&dq=difference+between+multiprogramming+and+multitasking&hl=en&sa=X&ei=fl4oUe--NsL9rAeZ-oCwDA&ved=0CC0Q6AEwADgK#v=onepage&q=difference%20between%20multiprogramming%20and%20multitasking&f=true
The first efforts to multiprogramming systems took place in1960s. Several different programs in batch were loaded in the computer memory, and the first one began to run. when the first program reached an instruction waiting for peripheral, the context of this program was stored away, and the second program in memory was given a chance to run. this process continued until all programs finished running. Multiprogramming does not guarantee that a program will run in a timely manner.
ReplyDeletewhen computer usage evolved from batch mode to interactive mode, multiprogramming was no longer a suitable approach. each user want to see his program was the only program in the computer.
ReplyDeleteThis comment has been removed by the author.
ReplyDelete