Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Aptitude
  • Engineering Mathematics
  • Discrete Mathematics
  • Operating System
  • DBMS
  • Computer Networks
  • Digital Logic and Design
  • C Programming
  • Data Structures
  • Algorithms
  • Theory of Computation
  • Compiler Design
  • Computer Org and Architecture
Open In App
Next Article:
Spooling in Operating System
Next article icon

Spooling in Operating System

Last Updated : 03 Nov, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report

In the Operating System, we had to provide input to the CPU, which then executed the instructions and returned the output. However, there was a flaw in this strategy. In a typical situation, we must deal with numerous processes, and we know that the time spent on I/O operations is very large in comparison to the time spent by the CPU on instruction execution. So, in the old approach, one process will provide input using an input device, and the CPU will be idle during this time. The instruction is then carried out by the CPU, and the output is once more sent to an output device while the CPU is still in an idle state. The following process begins its execution after displaying the output. As a result, the CPU sits idle the majority of the time, which is the worst situation for operating systems. Spooling is a notion that is relevant in this situation.

Spooling

Spooling is an acronym for simultaneous peripheral operation online. Spooling is the process of temporary storage of data for use and execution by a device, program, or system. Data is sent to and stored in main memory or other volatile storage until it is requested for execution by a program or computer. Spooling makes use of the disc as a large buffer to send data to printers and other devices. It can also be used as an input, but it is more commonly used as an output. Its primary function is to prevent two users from printing on the same page at the same time, resulting in their output being completely mixed together. It prevents this  because it uses the FIFO(First In First Out) strategy to retrieve the stored jobs in the spool, and that creates a synchronization preventing the output to be completely mixed together.

It also aids in the reduction of idle time, as well as overlapped I/O and CPU. Simple forms of file management are frequently provided by batch systems. The access to the file is sequential. Batch systems do not necessitate the management of time-critical devices.

Spooling in OS
 

How Spooling Works in Operating Systems?

  • Spooling requires the creation of a buffer known as SPOOL, which is used to hold off jobs and data until the device in which the SPOOL is created is ready to use and execute the job or operate on the data.
  • When a faster device sends input to a slower device to perform an operation, it acts as a SPOOL buffer by using any secondary memory attached. This input is retained in the SPOOL until the slower device is ready to use it. When the slower device is ready, the input in the SPOOL is loaded into main memory for the operations that are required.
  • A device can connect to multiple input devices, each of which may require some data processing. As a result, all of these input devices may store their data in secondary memory (SPOOL), which can then be executed sequentially by the device. This prevents the CPU from becoming idle at any time. As a result, Spooling is a combination of buffering and queuing.
  • After the CPU generates some output, this output is first saved in the main memory. This output is transferred to the secondary memory from the main memory, and from there, the output is sent to the respective output devices.

Example

  • Printing is the most obvious application of Spooling. The documents to be printed are saved in the SPOOL and then added to the printing queue. During this time, many processes can run and use the CPU without waiting while the printer runs the printing process on each document one by one.
Example of Spooling
 

Advantages

  • The spooling operation makes use of a disc as a very large buffer. 
  • It enables applications to run at the CPU's speed while I/O devices operate at their full speed.
  • Spooling, on the other hand, is capable of overlapping I/O operations for one job with processor operations for another.

Disadvantages

  • Depending on the volume of requests received and the number of input devices connected, spooling needs a lot of storage.
  • Since the SPOOL is created in the secondary storage, having lots of input devices active at once may cause the secondary storage to fill up quickly and increase disc traffic. As a result, the disc becomes slower and slower as the volume of traffic grows.

Next Article
Spooling in Operating System

A

abhishekaslk
Improve
Article Tags :
  • Operating Systems
  • Operating Systems-Input Output Systems

Similar Reads

    Process in Operating System
    A process is a program in execution. For example, when we write a program in C or C++ and compile it, the compiler creates binary code. The original code and binary code are both programs. When we actually run the binary code, it becomes a process. A process is an 'active' entity instead of a progra
    3 min read
    Multi Processing Operating System
    The operating system functions like a manager of all the available resources. Therefore operating system is defined as an interface between the system and the user. There are various types of operating systems such as Batch Operating Systems, Multi-programming Operating Systems, distributed operatin
    4 min read
    Single-User Operating System
    Single user operating system is also known as a single-tasking operating system, and a single-user operating system is designed especially for home computers. A single user can access the computer at a particular time. The single-user operating system allows permission to access your personal comput
    3 min read
    Batch Processing Operating System
    In the beginning, computers were very large types of machinery that ran from a console table. In all-purpose, card readers or tape drivers were used for input, and punch cards, tape drives, and line printers were used for output. Operators had no direct interface with the system, and job implementat
    6 min read
    System Protection in Operating System
    Introduction: System protection in an operating system refers to the mechanisms implemented by the operating system to ensure the security and integrity of the system. System protection involves various techniques to prevent unauthorized access, misuse, or modification of the operating system and it
    3 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences