Multiprogramming and Multitasking

Q22. What is meant by the terms multiprogramming and multitasking?

Ans. Multiprogramming refers to presence of more than one user programs, all active, simultaneously in the memory and their execution which takes place in interleaved fashion.

Multitasking refers to simultaneous working of two different tasks inside computer for example, the CPU is executing and side by side the printer is printing.

Medium Term Scheduler

Q1. Explain Medium Term Scheduler.

Ans. Some operating system such as time sharing system may introduce an additional intermediate level of scheduling. The key idea behind this scheduler is that to remove processes from memory and reduces the degree of multiprogramming. Later, the process can be reintroduced into memory and its execution can be continue from where it left. The scheme is called swapping.

Long Term/Job Scheduler

Q1. Explain Long Term/Job Scheduler.

Ans. To add new processes to the pool of processes to be executed.

It selects processes from its pool and loads them into main memory for execution. It executes much less frequently, that may separate creation of one new process and the next. It controls the degree of multiprogramming. If the degree of multiprogramming is stable than the average rate of process creation must be equal to the average departure rate of process leaving the system. So the long term scheduler need to be invoked only when a process leaves the system because of the longer interval between executions, the long term scheduler takes more time to decide which process should be selected.

 

Multiuser

Q1. Explain Multiuser.

Ans. The term multiprogramming denotes an operating system that, in addition to support multitasking, provide sophisticated forms of memory protection and enforces concurrency control when process access shared input/output devices and files.

Multiprogramming operating system usually support multiple users, in which case they are also called multiuser system. Multiuser operating systems provides facilities for maintenance if individual user environments, require user authentication for security and protection and provide per-user resource usage accounting.

Multiprogramming

Q1. Explain Multiprogramming.

Ans. Except as simple embedded systems, mono-programming is hardly used any more. Most modern systems allow multiple processes to run at the same time. Having multiple processes running at once means that when one process is blocked waiting for input/output to finish another one can use the CPU. The multiprocessing increases the CPU utilization. Network servers always have the ability to run multiple processes at the same time, but most client machines also have ability now-a-days.

The easiest way to achieve multiprogramming is simply to divide memory up into n (possibly unequal) partitions. This partitioning can be done manually when the system is started up.

When a job arrives it can be put into the input queue for the smallest partition large enough to hold it. Since the partitions are fixed in this scheme any space in a partition not used by a job is lost. The disadvantage of sorting the incoming jobs into separate queues becomes apparent when the queue for a large partition is empty but the queue for a small partition is full, as is the case for partition 1 and 3.

 

Differentiate between Multi-Programming and Multi-Threading

Q1. Differentiate between Multi-Programming and Multi-Threading.

Ans.

Multi Programming Multi Threading
1. Multiprogramming is a rudimentary form of parallel processing in which several programs are run at the same time on one processor. 1. Multi-threading is the ability of a program or an operating system process to manage its use by more than one user at a time.
2. Since there is only one processor, there can be no true simultaneous execution of different programs. 2. Even manage multiple requests by the same user without having to have multiple copies of the program running in the computer.
3. Instead the operating system executes part of one program, then part of another, and so on. 3. In some situation a single application may be required to perform several similar tasks.
4. To the user it appears that all programs are executing at the same time. 4. Example as web server accepts client requests for web pages, images, sound and so forth. A busy web server may have several of clients. Concurrently accessing it, if the web server runs as a traditional single-threaded process, it would be able to service only one client at a time. The amount of time that a client might have to wait for its request to be serviced could be enormous.
5. The operating system selects a job from the job pool and starts executing a job, when that job needs to wait for any input/output operations the CPU are switched to another job. So the main idea here is that the CPU is never idle. 5. Resources sharing economy and utilization of multiprocessor architectures multi-threading concept can be used.