How are spool job numbers allocated

Using a defined set of ranges depending on the number of active jobs.

After a process is first started it is initialized so that when it spools its first print job it will look for an unused print job number in the range 1 to 63 and will use the first one found. If it is unable to find a spare job number it will expand its search for job numbers the range 1 to 127, if that fails the range is extended to 64 to 255.

When an unused job number is found the process will remember the last job number used and also the range that was being searched. Then, when it next needs a new job number it will search from the last job number in the same range.

So the extension of searched ranges follows the following pattern:

Start
End
1
63
1
127
64
255
128
511
256
1023
512
2047
1024
4095
2048
8191
4096
16383
8192
32767
16384
65535
32768
65535
1
65535

Back to articles