DEV Community

Cover image for Printer Spooler Problem | Operating System - M03 P03
Rahul Mishra
Rahul Mishra

Posted on • Originally published at programmingport.hashnode.dev

Printer Spooler Problem | Operating System - M03 P03

This is a multipart blog article series, and in this series I am going to explain you the concepts of operating system. This article series is divided into multiple modules and this is the third module which consists of 10 articles.

In this article we will discuss about printer spooler problem, and how can we overcome that problem.

Printer spooler problem

  • As we know that printer is a peripheral device, so it is slower in comparison of CPU and memory.
  • So, if multiple users send some file to printer to print then spooler comes into play.
  • Spooler is a program in printer which stores all the files coming to print and when printer is free it gives it to the printer in sequential manner.

This four line code is executed by each process in order to store its file in spooler directory to print.

Load Ri, m[in]
store SD[Ri], "F-N"
INCR Ri
store m[in], Ri
Enter fullscreen mode Exit fullscreen mode

in: Shared variable
m: Memory location
Ri: Register
F-N: File name
SD: Spooler directory

  1. Line 1: In line one we are loading free memory location m[in], in register Ri
  2. Line 2: In line two we are storing file name (F-N) in spooler directory (SD) at position Ri, which is for instance 0
  3. Line 3: In line three we are incrementing the count of Ri from 0 to 1, so next file can be stored in at index 1
  4. Line 4: In line four the new file will be stored at incremented memory location m[in]

So this was all about printer spooler problem. Hope you liked it and learned something new from it.

If you have any doubt, question, queries related to this topic or just want to share something with me, then please feel free to contact me.

📱 Contact Me

Twitter
LinkedIn
Telegram
Instagram

📧 Write a mail

rahulmishra102000@gmail.com

🚀 Other links

GitHub
HackerRank

Top comments (1)

Collapse
 
withmahimasingh profile image
Mahima Singh

This is helpful. Thank you!