load-sharing for printers

load-sharing for printers

Post by Scott Steaga » Tue, 28 Jun 1994 23:34:18



Guys,

    I'm looking for load-sharing software for two HPIII SI printers connected
to a Sparc 10 running SUNOS 4.1.3......Does it exist if so where?????????

Thanks!!!
Scott.Steagall

 
 
 

load-sharing for printers

Post by John Hasca » Wed, 29 Jun 1994 00:25:00



}    I'm looking for load-sharing software for two HPIII SI printers connected
}to a Sparc 10 running SUNOS 4.1.3......Does it exist if so where?????????

   If you have source to a version of lpd (say from BSD) it is pretty
   simple to run two or more queues out of the same spool directory
   (voila, instant load sharing).

   Our source base is Ultrix (which has wandered a bit from BSD), but
   this ought to give the idea.

   Other than definitions and such, all there is to it is:

        MT = pgetflag("mt");    /* multi-threaded queue hack */
             ...
        if (MT && (flock(fileno(cfp), LOCK_EX|LOCK_NB) < 0)) {
                /*
                 * if this is a MultiThreaded Queue make sure
                 * a different thread (daemon) isn't already
                 * busy working on this job
                 * John Hascall, 17 Sept 93
                 */
                if (errno == EWOULDBLOCK) {
                        fclose(cfp);
                        return(js_busy);
                }
        }

    right after it opens the control file (cfp).  And where this
    returns:
                switch (job_status) {
                    case js_ok:
                        return 1; /* job ok and printed */
                    case js_busy:             /* ... add this .. */
                        --notlocked;
                        return 0; /* another daemon is printing this one */

    And where the queue is processed:

        while (1) {
            ... nitems = getq(&queue) ...
            notlocked = nitems;                  /* add this... */
            for (qp = queue; nitems--; ) {
                 ... queue processed here ...
            }
            if (notlocked == 0) {                /* and this ... */
                 status("All jobs in progress, sleeping");    /* [opt] */
                 sleep(10);                     /* arbitrary sleep amount */
            }
        }

    The sleep is just to prevent the "idle" lpd's from spinning tightly
    checking the lock over and over and over... (say, if you have 4 lpds
    and only 3 jobs in the queue at the moment).

John
--
John Hascall                   ``An ill-chosen word is the fool's messenger.''
Systems Software Engineer
Project Vincent
Iowa State University Computation Center  +  Ames, IA  50011  +  515/294-9551

 
 
 

load-sharing for printers

Post by Michael Joost » Fri, 01 Jul 1994 05:06:01


       I'm looking for load-sharing software for two HPIII SI printers connected
   to a Sparc 10 running SUNOS 4.1.3......Does it exist if so where?????????

If you don't need all the thrills of NeWSprint, we are here still using PLP
(Powell's Line Printer), a reimplementation of BSD4.[23] lpd with more
features, that also allows feeding two printers from one queue. Last time I
checked, there was a little port to Solaris available from
atlas.ce.washington.edu:/pub/plp.tar.Z.

Michael

--
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Michael Joosten   |       Tel.  : (+49) (+) 5251-284 168                 |
| CADLAB            |       Fax   : (+49) (+) 5251-284 140                 |

| 33102 Paderborn   |               ...!uunet!unido!cadlab!joost           |

|--------------------------------------------------------------------------|
| CADLAB is a cooperation between Uni-GH Paderborn & SNI AG                |
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~