In: Computer Science
Quick Solution Please.....
OS (Operating Systems)
[1] Briefly, what is the difference between:
1- Buffering & Spooling.
2- Synchronous & Asynchronous I/O.
3- CPU-bound & I/O-bound jobs.
4- Multiprogramming & Timesharing.
5- Logical & Physical addresses.
6- User & Monitor modes in Operating System.
[2] (i) Define Timesharing.
(ii) In a one processor system, there is an interrupt clock which is set to a “time slice Q”, that is, every Q an interrupt occurs to stop the process. There is only one I/O device in the system which is interrupted when the process needs an I/O. There are 3 processes A, B, C.
Process A executes an I/O interrupt every T units of time.
Process B executes an I/O interrupt every 2T units of time.
Process C executes an I/O interrupt every 3T units of time.
(a) Which of the above processes will benefit the most and which is not when Q = T.
Explain your answer
(b) Which of the above processes will benefit the most and which is not when Q = 2T.
Explain your answer
(a) Which of the above processes will benefit the most and which is not when Q = 3T.
Explain your answer
What is the best value should Q takes for good performance ? explain your answer in full.
[1] Briefly, what is the difference between:
1- Buffering & Spooling.
2- Synchronous & Asynchronous I/O.
3- CPU-bound & I/O-bound jobs.
4- Multiprogramming & Timesharing.
5- Logical & Physical addresses.
6- User & Monitor modes in Operating System.
[2] (i) Define Timesharing.
(ii) In a one processor system, there is an interrupt clock which is set to a “time slice Q”, that is, every Q an interrupt occurs to stop the process. There is only one I/O device in the system which is interrupted when the process needs an I/O. There are 3 processes A, B, C.
Process A executes an I/O interrupt every T units of time.
Process B executes an I/O interrupt every 2T units of time.
Process C executes an I/O interrupt every 3T units of time.
(a) Which of the above processes will benefit the most and which is not when Q = T.
Explain your answer
(b) Which of the above processes will benefit the most and which is not when Q = 2T.
Explain your answer
(a) Which of the above processes will benefit the most and which is not when Q = 3T.
Explain your answer
What is the best value should Q takes for good performance ? explain your answer in full.
1.
1. Difference between Buffering and Spooling
S.NO | Key | Spooling | Buffering |
1. | Definition |
Spooling, an acronym of Simultaneous Peripheral Operation On-line (SPOOL), puts data into a temporary working area so it can be accessed and processed by another program or resource. |
On other hand Buffering is an act of storing data temporarily in the buffer. It helps in matching the speed of the data stream between the sender and receiver. |
2. | Internal implementation |
Spooling overlaps the input and output of one job with the computation of another job. |
Buffering on other hand overlaps the input and output of one job with the computation of the same job. |
3. | Resource Requirement |
Spooling requires less resource management as compare to buffering as different resources manages the process for specific jobs. |
On other hand Buffering requires more resource management as compare to spooling as same resource manages the process of same divided job. |
4. | Processor |
Spooling can also process data at the remote sites. The spooler only has to notify when a process gets completed at the remote site so that spooler can spool next process to the remote side device. |
On other hand Buffering do not support the remote processing. |
5. | Efficient |
Spooling is more efficient than buffering. |
On other hand Buffering is less efficient than spooling. |
6. | Size on memory |
It considers disk as a huge spool or buffer. |
On other hand Buffer is a limited area in main memory. |
3. Differece between CPU bound and I/O bound jobs
S.NO | CPU bound | I/O bound |
1. | It means the rate at which process progresses is limited by the speed of the CPU | It means the rate at which process progresses is limited by the speed of the I/O subsystem |
2. | A task that performs calculations on a small set of numbers, for example multiplyinf small set of matrices, is likely to be CPU bound | A task that processes data from disk, for example, counting the number of lines in a file is likely to be I/O bound |
3. | A program is CPU bound if it would go faster if the CPU were faster | A program is I/O bound if it would go faster if the I/O subsytem was faster |
4. |
CPU bound means the program is bottlenecked by the CPU, or central processing unit |
while I/O bound means the program is bottlenecked by I/O, or input/output, such as reading or writing to disk, network, etc. |
4. Difference between multiprogramming and time sharing
Multiprogramming:
In this our aim is to achieve maximum CPU ( and other System resources) utilization with SINGLE PROCESSOR (i.e. Single CPU). If we are running a SINGLE Program on a SINGLE processor , then we can’t achieve maximum CPU utilization because chances are that the Program might wait for some Input/Output operations to complete, till then CPU will remain Idle. Hence we run multiple program on SINGLE processor, so that whenever a particular program waits for some I/O or any other operations, then CPU would NOT sit idle and SWITCH to some other program to execute.
Timesharing:
It is the LOGICAL extension of Multi Programming only. The DIFFERENCE is that in Multi Programming , we do achieve effective utilization of system resources (Like CPU, Memory etc.) BUT we do NOT have any USER INTERACTIONS. While in Multi tasking (Time Sharing) we do have User Interaction (like Inputs from USER through mouse,keyboards etc) and then achieve Effective utilization of System resources. ALSO here since we are taking inputs from User , so RESPONSE TIME also matters. It gives impression to User that the entire System is dedicated for its use while it is shared among different Users.
5. Difference between Logical and Physical adresses
S.NO | Logical Adresses | Physical Adresses |
1. | The basic difference between Logical and physical address is that Logical address is generated by CPU in perspective of a program. |
On the other hand, the physical address is a location that exists in the memory unit. |
2. |
The set of all logical addresses generated by CPU for a program is called Logical Address Space. |
However, the set of all physical address mapped to corresponding logical addresses is referred as Physical Address Space. |
3. |
The logical address is also called virtual address as the logical address does not exist physically in the memory unit. |
The physical address is a location in the memory unit that can be accessed physically. |
4. |
Identical logical address are generated by Compile-time and Load time address binding methods. |
Identical physical address are generated by Compile-time and Load time address binding methods. |
5. |
The logical address generated while run-time address binding method differs from each other. |
The physical address generated while run-time address binding method differs from each other. |
6. |
The logical address is generated by the CPU while program is running |
whereas, the physical addres is computed by the MMU (Memory Management Unit). |
2.
1. Time Sharing:
In computing, time-sharing is the sharing of a computing resource among many users at the same time by means of multiprogramming and multi tasking.
Time-sharing enables many people, located at various terminals, to use a particular computer system at the same time. Multitasking or Time-Sharing Systems is a logical extension of multiprogramming. Processor’s time is shared among multiple users simultaneously is termed as time-sharing.
The main difference between Time-Sharing Systems and Multiprogrammed Batch Systems is that in case of Multiprogrammed batch systems, the objective is to maximize processor use, whereas in Time-Sharing Systems, the objective is to minimize response time.
Multiple jobs are implemented by the CPU by switching between them, but the switches occur so frequently. So, the user can receive an immediate response. For an example, in a transaction processing, the processor executes each user program in a short burst or quantum of computation, i.e.; if n users are present, then each user can get a time quantum. Whenever the user submits the command, the response time is in few seconds at most.
An operating system uses CPU scheduling and multiprogramming to provide each user with a small portion of a time. Computer systems which were designed primarily as batch systems have been modified to time-sharing systems.
Advantages of Timesharing operating systems are −
Disadvantages of Time-sharing operating systems are −