2
$\begingroup$

Which of the following features will characterize an OS as multiprogrammed OS?

  1. More than one program may be loaded into main memory at the same time.
  2. If a program waits for certain event another program is immediately scheduled.
  3. If the execution of a program terminates, another program is immediately scheduled.

My attempt:

Only, statement (1) is correct, but statement (2) and (3) may not be true when there were no process at ready state. So, they should be false.

But, somewhere it explained as both statement (1) and (2) are true, and (3) is false.

And also, official key is given all statements are correct.

Can you explain it, please?

$\endgroup$
  • $\begingroup$ I suppose by the term 'immediately' it requires the processes to be present in the ready queue or in the main memory hence multi-programmed. $\endgroup$ – Shubham Singh rawat Dec 26 '16 at 12:02
2
$\begingroup$

Sorry That is not a complete answer but i hope it can help you .

"One of the most important aspects of operating systems is the ability to multiprogram. A single program cannot, in general, keep either the CPU or the I/O devices busy at all times. Single users frequently have multiple programs running. Multiprogramming increases CPU utilization by organizing jobs (code and data) so that the CPU always has one to execute. The idea is as follows: The operating system keeps several jobs in memory simultaneously (Figure 1.9). Since, in general, main memory is too small to accommodate all jobs, the jobs are kept initially on the disk in the job pool. This pool consists of all processes residing on disk awaiting allocation of main memory. The set of jobs in memory can be a subset of the jobs kept in the job pool. The operating system picks and begins to execute one of the jobs in memory.Eventually, the job may have to wait for some task, such as an I/O operation, to complete. In a non-multiprogrammed system, the CPU would sit idle. In a multiprogrammed system, the operating system simply switches to, and executes, another job. When that job needs to wait, the CPU switches to another job, and so on. Eventually, the first job finishes waiting and gets the CPU back. As long as at least one job needs to execute, the CPU is never idle. This idea is common in other life situations. A lawyer does not work for only one client at a time, for example. While one case is waiting to go to trial or have papers typed, the lawyer can work on another case. If he has enough clients, the lawyer will never be idle for lack of work. (Idle lawyers tend to become politicians, so there is a certain social value in keeping lawyers busy.) Multiprogrammed systems provide an environment in which the various system resources (for example, CPU, memory, and peripheral devices) are utilized effectively, but they do not provide for user interaction with the computer system. Time sharing (or multitasking) is a logical extension of multiprogramming. In time-sharing systems, the CPU executes multiple jobs by switching among them, but the switches occur so frequently that the users can interact with each program while it is running."

enter image description here

"Time sharing and multiprogramming require that several jobs be kept simultaneously in memory. If several jobs are ready to be brought into memory, and if there is not enough room for all of them, then the system must choose among them. Making this decision involves job scheduling."

'Having several programs in memory at the same time requires some form of memory management'

Operating System Concepts Essentials -Abraham Silberschatz -second edition [2013] section [1.4]

$\endgroup$
  • $\begingroup$ 2013 is hard to believe (unless that is the time of a reprint). I haven't heard the term "timesharing" in many, many years. And any statement completely ignorant of virtual memory. $\endgroup$ – gnasher729 Dec 27 '16 at 14:02
  • $\begingroup$ time sharing or multitasking are the same. time sharing or multitasking is a logical extension of multiprogramming. $\endgroup$ – W.R.P.S Dec 27 '16 at 14:21
  • $\begingroup$ The point is I learned what "time sharing" is in the late 70s. I haven't heard the term used in this millennium and likely not in the last ten years of the previous one. Ask someone whether their iPhone can do time sharing and the answer isn't "yes" but "what the hell are you talking about?". $\endgroup$ – gnasher729 Dec 27 '16 at 15:37
  • $\begingroup$ @gnasher729 sorry i'm just student in computer science , i read this book for operating system course and i thought this paragraph maybe be helpful for OP . but you are right my knowledge is not complete. can you help me what word i use Instead of time sharing ? $\endgroup$ – W.R.P.S Dec 27 '16 at 16:13
1
$\begingroup$

Your textbook is correct. The definition of a multiprogramming system is one in which more than one program can be loaded into main memory simultaneously, and the operating system can improve cpu utilization by switching between programs when the program that has been using the cpu waits for an event such as I/O.

The reason you need both halves of the definition is that the objective of multiprogramming is to maximize utilization of the cpu, which was the most expensive component back in the 1960s when the term first came into use.

The program you are switching to needs to be in main memory, because you are trying to cover up I/O delay. If the program you were switching to were not in main memory, then you'd need to initiate another (slow) I/O request to get the instructions to the cpu.

On the other hand, if you were not switching quickly between programs at the point of an I/O then there would be little point in keeping the second program in (expensive) main memory.

I agree with you that your book is using the term immediately rather vaguely. The operation of the scheduler just needs to be much faster than the time to do the I/O operation, not "immediate" or "instantaneous".

I was surprised that I couldn't turn up a particularly good online definition to reference. The wikipedia discussion seems to mainly give motivation, as does @vonbrand's otherwise excellent answer here.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.