ADVERTISEMENT
ADVERTISEMENT

Home » Operating Systems

Differences between buffering and spooling

Buffering vs Spooling: In this tutorial, we are going to study what is buffering and spooling? Also, we will discuss the key differences between buffering and spooling.
Submitted by Monika Jha, on November 22, 2019

To improve the system performance and efficiency of the computer by overlapping Input/output and processing there are two approaches: Buffering and Spooling.

1) Buffering

In the main memory, buffer is a region which is used to store or hold the data temporarily that is being transmitted either between two devices or between a device or an application, it means buffer temporarily stores data that is being. The act of storing data or information for a shot time in the buffer is called buffering.

  • It is a technique of overlapping I/O and processing of single job. After data has been read and CPU is about to start operating on it the input devices are instructed to begin the next input immediately.
  • By the time that the CPU is ready for the next data item, the input device will have finished reading it.
  • The CPU can then begin processing the newly read data while input device start to read following data. Similarly, this can be done for O/P. In this case, CPU creates data that is put into a buffer until an output device can accept it.

For example, when we download a video or audio file, some part of the downloaded file is placed in the buffer and then played. When that clip is played, the device continuously downloads the file and places it into the buffer.

Uses of Buffering

  • It resolves the problem of speed mismatch between two devices, between which the data is transmitted.
  • Before sending or receiving it manipulates data. The large message is fragmented into the small fragments or packets and transmitted over the network. At the receiving end, these packets are accumulated in the buffer and reassembled to form the complete large message.
  • It also supports copy semantics that is the version of data in the buffer and at the time of system call both should be same is guaranteed to be the version of data at the time of system call irrespective of any change to data in the buffer.

2) Spooling

It is the process in which jobs from the cars are read directly onto the disk and the location of that card in the disk is recorded in a table by the Operating System. When that job is required for execution, it is read from the disk.

Similarly, when the job requires a printer to output a line, that particular line is copied onto the disk and system buffer and after job, output is read from the disk and printed by the printer.

spooling in OS

Spooling

Why it is called as Spooling (simultaneous peripheral operation online)?

By spooling more than one input and output devices can interact with disk simultaneously and provide an impression that these devices interact directly with CPU, so it is called simultaneous peripheral operation online.

Spooling increases the performance of system and also leads to multiprogramming. The specification for spooling are some disk space and some tables but it makes busy both the CPU and I/O devices as much as possible.

Differences between Buffering and Spooling

  1. Spooling can handle the I/O of one job as well as computation of another job at the same time while buffering handles I/O of one job along with its computation.
  2. Spooling is an acronym for Simultaneous Peripheral Operation online while buffering is not an acronym.
  3. Spooling is more efficient as it can overlap processing two jobs at a time but buffering is less efficient because it overlaps input/output of one job with the execution of the same job.
  4. Spool uses the disk as a huge buffer whereas buffer is a limited area in main memory.

References:

ADVERTISEMENT



ADVERTISEMENT



Comments and Discussions


ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.