What is the difference between Caching and Spooling?

Spooling :

  • Spooling stands for ‘Simultaneous Peripheral Operation On-Line‘.
  • A spool is a buffer that holds output for a device, such as a printer, that cannot accept interleaved data streams.
  • Spooling is useful for the devices which have differing data access rate.It is used mainly when processes share some resource and needed to have synchronization.
  • With spooling all process can access the resource without waiting.
  • For Example, although a printer can serve only one job at a time, several applications may wish to print their output concurrently, without having their output mixed together. The operating system solves this problem by intercepting all output to the printer. Each application’s output is spooled to a separate disk file. When an application finishes printing, the spooling system queues the corresponding spool file for output to the printer. The spooling system copies the queued spool files to the printer one at a time.
  • Some devices, such as tape drives and printers, cannot usefully multiplex the I/O requests of multiple concurrent applications. Spooling is one way operating systems can coordinate concurrent output.

Caching :

  • A Cache is a region of fast memory that holds copies of data.
  • It is a special high-speed storage mechanism. It can be either a reserved section of main memory or an independent high-speed storage device.
  • The difference between a buffer and a cache is that a buffer may hold the only existing copy of a data item, whereas a cache, by definition, holds a copy on faster storage of an item that resides elsewhere.
  • A cache’s main purpose is to reduce access to the underlying slower storage for more frequently used files or resource.
  • For examples, Memory Caching, Disk Caching, Web Caching(used in browser), Database Caching etc.

Leave a Reply

Your email address will not be published. Required fields are marked *