Comment by icebraining
10 years ago
How would you avoid having a common print queue, when all the documents can't fit in the printer memory?
10 years ago
How would you avoid having a common print queue, when all the documents can't fit in the printer memory?
It's been a while since I bought a printer that connected via any means other than Ethernet or Wifi, so the printer already needs to manage its own queue regardless of what the client computers do.
For printer that attach directly, there could be a daemon that arbitrates access and handles accounting or the system could simply allocate the printer to the logged-in user. For directly connected printers on multi-user systems, you'd want a real daemon, of course.
For daemons that mediate access, IMO the arbitration and accounting should be split from formatting and rasterization (if needed). For accounting and arbitration, the right way to do it is to speak something like Printer Job Language. I actually wrote a daemon like this years ago. I wonder if I still have the code. It actually counted pages regardless of how they were submitted.
Anyway, for a normal desktop machine, I think that the system daemon is silly these days.
I think you overestimate the queue size of a regular printer. Many still only have 32MB of RAM, so they can barely hold more than a few pages, if they have graphics. In my office, it's common for the OS queue to be waiting for the printer queue to free up some space.
So what?
If three users on a workstation each print a document that uses lots of RAM, two of them are going to have to wait no matter what.
1 reply →
Have the printer act as a server to which each of the sandboxed print queues talks directly, seeking permission to send data, and let the printer handle flow control.
Not saying this is necessarily a good idea, but it avoids a system-wide print queue, all you need at the system level is a service locator to let you know where the printer is that you need to contact.
It's not a bad idea, that's a print server or IP printer. But it's a modern system, and the print daemon architecture predates printers having their own microprocessors. It may even predate TCP.
The need to print documents predates Unix. :) Remember that the official excuse for getting a PDP-11 for developing Unix was to work on troff.
Ostensibly, you're right, but then the answer to "why do we need a system daemon" is "because Linux distros don't control the firmware of all printers nor can they tell manufacturers what to do."
In the case where a printer isn't intelligent enough to act as its own server, you could create another daemon whose sole function is to control access to the printer. Separation of concerns: formatting of pages and access control need not be the same piece of software.
1 reply →