Question

In: Computer Science

[1] Briefly, what is the difference between: 1- Buffering & Spooling. 2- Synchronous & Asynchronous I/O....

[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.

Solutions

Expert Solution

1

Spooling

Spooling stands for Simultaneous peripheral operation online. A spool is similar to buffer as it holds the jobs for a device until the device is ready to accept the job. It considers disk as a huge buffer that can store as many jobs for the device till the output devices are ready to accept them.

Buffering

The main memory has an area called buffer that is used to store or hold the data temporarily that is being transmitted either between two devices or between a device or an application. 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 the receiver. If the speed of the sender’s transmission is slower than the receiver, then a buffer is created in the main memory of the receiver, and it accumulates the bytes received from the sender and vice versa.

The basic difference between Spooling and Buffering is that Spooling overlaps the input/output of one job with the execution of another job while the buffering overlaps the input/output of one job with the execution of the same job.

Differences between Spooling and Buffering –

· The key difference between spooling and buffering is that Spooling can handle the input/output of one job along with the computation of another job at the same time while buffering handles input/output of one job along with its computation.

· Spooling stands for Simultaneous Peripheral Operation online. Whereas buffering is not an acronym.

· Spooling is more efficient than buffering, as spooling can overlap processing two jobs at a time.

· Buffering uses limited area in main memory while Spooling uses the disk as a huge buffer.

Comparison

Spooling

Buffering

Basic difference

It overlap the input/output of one job with the execution of another job

It overlaps the input/output of one job with the execution of the same job

Full form

Simultaneous peripheral operation online

No full form

Efficient

Spooling is more efficient than buffering

Buffering is less efficient than spooling

Size

It considers disk as a huge spool or buffer

Buffer is a limited area in main memory

2

Synchronous & Asynchronous I/O

The send, receive, and reply operations may be synchronous or asynchronous. A synchronous operation blocks a process till the operation completes. An asynchronous operation is non-blocking and only initiates the operation. The caller could discover completion by some other mechanism discussed later. (Does it make sense to have an asynchronous RPC send?)

The notion of synchronous operations requires an understanding of what it means for an operation to complete. In the case of remote assignment, both the send and receive complete when the message has been delivered to the receiver. In the case of remote procedure call, the send, receive, and reply complete when the result has been delivered to the sender, assuming there is a return value. Otherwise, the send and receive complete when the procedure finishes execution. During the time the procedure is executing, the sender and receiver are in a rendezvous, as mentioned before.

Note that synchronous/asynchronous implies blocking/not blocking but not vice versa, that is, not every blocking operation is synchronous and not every non blocking operation is asynchronous. For instance, a send that blocks till the receiver machine has received the message is blocking but not synchronous since the receiver process may not have received it. Similarly, we will see later a Xinu receive that is non-blocking but is not asynchronous. These definitions of synchronous/asynchronous operations are similar but not identical to the ones given in your text books, which tend to equate synchronous with blocking.

Asynchronous message passing allows more parallelism. Since a process does not block, it can do some computation while the message is in transit. In the case of receive, this means a process can express its interest in receving messages on multiple ports simultaneously. (The select primitive discussed later provides this facility for synchronous receives). In a synchronous system, such parallelism can be achieved by forking a separate process for each concurrent operation, but this approach incurs the cost of extra process management. This cost is typically bearable with lwps but not hwps.

Asynchronous message passing introduces several problems. What happens if a message cannot be delivered? The sender may never wait for delivery of the message, and thus never hear about the error. Similarly, a mechanism is needed to notify an asynchronous receiver that a message has arrived. The operation invoker could learn about completion/errors by polling, getting a software interrupt, or by waiting explicitly for completion later using a special sycnhronous wait call. An asynchronous operation needs to return a call/transaction id if the application needs to be later notified about the operation. At notification time, this id would be placed in some global location or passed as an argument to a handler or wait call.

Another problem related to asynchronous message passing has to do with buffering. If messages sent asynchronously are buffered in a space managed by the OS, then a process may fill this space by flooding the system with a large number of messages.

3

CPU Bound means the rate at which process progresses is limited by the speed of the CPU.

· A task that performs calculations on a small set of numbers, for example multiplying small matrices, is likely to be CPU bound.

· A program is CPU bound if it would go faster if the CPU were faster.

I/O Bound means the rate at which a process progresses is limited by the speed of the I/O subsystem.

· A task that processes data from disk, for example, counting the number of lines in a file is likely to be I/O bound.

· A program is I/O bound if it would go faster if the I/O subsystem was faster.

4

What is Multiprogramming System?

Multiprogramming is the fast switching of CPU between several programs. A program is generally made up of several tasks. A task usually ends with some request to move data which would require some I/O operations to be executed. Multitasking was commonly done to keep the CPU busy, while the currently running program is doing I/O operations. Compared to other executing instructions, I/O operations are extremely slow. Even if a program contains a very small number of I/O operations, most of the time taken for the program is spent on those I/O operations. Therefore, using this idle time and allowing another program to utilize the CPU at that time will increase the CPU utilization. Multiprogramming was initially developed in late 1950s as a feature of operating systems and was first used in mainframe computing. With the introduction of virtual memory and virtual machine technologies, the use of multiprogramming was enhanced.

What is Time Sharing System?

Time sharing, which was introduced in 1960s, is the sharing of computing resources among several users at the same time. In time sharing systems, several terminals are attached to a single dedicated server having its own CPU. Actions/commands executed by the operating system of a time sharing system have a very short time span. Therefore the CPU is assigned to users at the terminals for a short time period, thus a user in a terminal gets the feeling that she has a CPU dedicated to her behind her terminal. The short time period that a command is executed on a time sharing system is called a time slice or a time quantum. With the development of internet, time sharing systems have become more popular since expensive server farms could host a very large number of customers sharing the same resources. Since the websites operate mainly in bursts of activity followed by periods of idle time, the idling time of one customer could be used effectively by the other, without any of them noticing the delay.

Main difference between multiprogramming and time sharing is that multiprogramming is the effective utilization of CPU time, by allowing several programs to use the CPU at the same time but time sharing is the sharing of a computing facility by several users that want to use the same facility at the same time. Each user on a time sharing system gets her own terminal and gets the feeling that she is using the CPU alone. Actually, time sharing systems use the concept of multiprogramming to share the CPU time between multiple users at the same time.

5

Differences Between Logical and Physical Address in Operating System

1. The basic difference between Logical and physical address is that Logical address is generated by CPU in perspective of a program whereas the physical address is a location that exists in the memory unit.

2. Logical Address Space is the set of all logical addresses generated by CPU for a program whereas the set of all physical address mapped to corresponding logical addresses is called Physical Address Space.

3. The logical address does not exist physically in the memory whereas physical address is a location in the memory that can be accessed physically.

4. Identical logical addresses are generated by Compile-time and Load time address binding methods whereas they differs from each other in run-time address binding method. Please refer this for details.

5. The logical address is generated by the CPU while the program is running whereas the physical address is computed by the Memory Management Unit (MMU).

6

Difference between User and Monitor Mode

User mode and monitor mode are distinguished by a bit called the mode bit.

User mode uses bit 1 and monitor mode uses bit 0.

At the boot time hardware starts with the monitor mode.

Also, at the time of interrupt user mode is shifted to the transfer mode.

The system always switches to the user mode before passing control to the user program.

Whenever the system gains control of the computer it works in monitor mode otherwise in user mode.


Related Solutions

Operating System: what is the difference between Synchronous & Asynchronous I/O.
Operating System: what is the difference between Synchronous & Asynchronous I/O.
(a) What is the difference between synchronous and asynchronous stream ciphers. (b) Who was Horst Feistel?...
(a) What is the difference between synchronous and asynchronous stream ciphers. (b) Who was Horst Feistel? (c) What is the main weakness of affine ciphers? (d) What is the Kerckhoffs’ principle? (e) Suppose a block cipher uses m-to-m bits S-boxes. How many bits are required to store the look-up table of k different such m-to-m bits S-boxes? Give a formula in terms of k and m. Hint: A look-up table for one DES S-box requires 256 bits of storage.
Human Resource Information Management; What is the difference between synchronous and asynchronous training format? What are...
Human Resource Information Management; What is the difference between synchronous and asynchronous training format? What are the key benefits of Web technology in managing the content of knowledge management systems? What service can personalization of knowledge management systems provide? What features of web-based collaboration give it advantages over teleconferencing or videoconferencing? What are the advantages of web-based training/knowledge management?
Quick Solution Please..... OS (Operating Systems) [1] Briefly, what is the difference between: 1- Buffering &...
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...
what the propagation delay can be on a synchronous and an asynchronous counter that needs to...
what the propagation delay can be on a synchronous and an asynchronous counter that needs to run at 200MHz? Show me how you would calculate this.
1. What is a divestiture? (2) 2. Briefly explain the difference between a spin-off and a...
1. What is a divestiture? (2) 2. Briefly explain the difference between a spin-off and a carve-out. (4) 3. Briefly explain bankruptcy costs(4)
1) What is the difference between the functions o long-term operational assets and investments?   2) What...
1) What is the difference between the functions o long-term operational assets and investments?   2) What is the difference between tangible and intangible assets? Give an example of each? 3) Why would a company choose to depreciate one piece of equipment using the double-declining-balance method and another piece of equipment using straight-line depreciation?
a)Differences between asynchronous and synchronous generators? Which one applies in the plants and why? b)Where do...
a)Differences between asynchronous and synchronous generators? Which one applies in the plants and why? b)Where do gas and steam turbines apply, not to mention in power plants? c) What are the main components of the wind generator system or solar-batteries-substation? d) What is the difference between using the star or triangle connection at the start of an engine? e) In equipment tests, what is the difference between type, routine and special tests? f) Why are insulated cables not used in...
1. What is the difference between ionoconformity and osmoconformity? 2. Mention and briefly describe two countercurrent...
1. What is the difference between ionoconformity and osmoconformity? 2. Mention and briefly describe two countercurrent mechanisms operating in cardiovascular and/or osmoregulatory physiology.
1. What is the difference between arguments, opinions and descriptions? 2. What is the difference between...
1. What is the difference between arguments, opinions and descriptions? 2. What is the difference between arguments and explanations, and what is the primary purpose of each?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT