Browse Prior Art Database

Print Job Processor State Machine

IP.com Disclosure Number: IPCOM000110334D
Original Publication Date: 1992-Nov-01
Included in the Prior Art Database: 2005-Mar-25
Document File: 5 page(s) / 194K

Publishing Venue

IBM

Related People

Carlock, JR: AUTHOR [+3]

Abstract

Disclosed is a design for a Print Job Processor State Machine. This is valuable because it simplifies a complex scheduling algorithm in a simple state machine. The logic that determines which state should be entered next is contained in one procedure (Determine_Next_Job_Piece), which must be called after each state has been exited. Note, also, that all error recovery is isolated in one procedure and the rest of the module need not concern itself with the complexities involved in any error recovery processing.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 36% of the total text.

Print Job Processor State Machine

       Disclosed is a design for a Print Job Processor State
Machine.  This is valuable because it simplifies a complex scheduling
algorithm in a simple state machine.  The logic that determines which
state should be entered next is contained in one procedure
(Determine_Next_Job_Piece), which must be called after each state has
been exited.  Note, also, that all error recovery is isolated in one
procedure and the rest of the module need not concern itself with the
complexities involved in any error recovery processing.

      This state machine is designed to work in conjunction with
another process that creates and maintains a Job Record Queue.  The
Job Record Queue is a queue of Job Record structures, each
representing a job that has been submitted for printing by the
Spooler.  This state machine continuously takes the oldest job off
the Job Record Queue, schedules the various job pieces for printing,
and (if no errors are encountered) takes the next job off the Job
Record Queue until the queue is empty.  It then waits until another
job appears on the queue (or until a timer expires, causing it to
terminate).

      The figure illustrates the Print Job Processor State Machine.
Note that the states are represented by the circles labeled S1 - S7.
The diamonds labeled P1 and P2 are procedures that determine which
state should be entered next.

      This state machine operates by iterating over a very simple
algorithm.  The knowledge of which state should be entered is
isolated in the Determine_Next_Job_Piece function.  Whenever a state
has finished executing, the Determine_Next_Job_Piece function is
called, and the appropriate next state is entered.  This algorithm
can be expressed as illustrated below:
      next_job_piece  =  initialization
      return  =  OK
      next_piece_set  =  FALSE
      DO FOREVER
      {
      if (next_piece_set  = =  FALSE)
      next_job_piece  =  Determine_ Next_Job_Piece (next_job_piece)
      return  =  Process_Job_Piece  (next_job_piece)
      if (return! = OK)
      next_piece_set  =  Process_Error (return, next_job_piece)
      }

      There are several functions introduced in this algorithm that
require some explanation:
*    Determine_Next_Job_Piece (P1)
     This function determines the next logical piece of the print job
that should be processed.  Most job pieces involve converting print
files (user's document, Header file, Trailer file, job statistics
file, etc.) and sending them to the printer for printing.  There are
also some special job pieces that must be processed, such as any job
initialization or termination processing that must be performed.
Determining the next job piece to print involves analysis of several
conditions:
*    What User Exits are active?
*    What User Exits are disabled (broken)?
*    What was the previous job piece that wa...