Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 May 2000 10:30:43 -0400
From:      Garance A Drosihn <drosih@rpi.edu>
To:        Chris Dillon <cdillon@wolves.k12.mo.us>, Dan Nelson <dnelson@emsphone.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: PROBLEM FOUND (sort of): Re: lpr: order of print requests
Message-ID:  <v04210107b535e522424f@[128.113.24.47]>
In-Reply-To:  <Pine.BSF.4.20.0005030746200.1907-100000@mail.wolves.k12.mo.us>
References:  <Pine.BSF.4.20.0005030746200.1907-100000@mail.wolves.k12.mo.us>

next in thread | previous in thread | raw e-mail | index | archive | help
At 7:56 AM -0500 5/3/00, Chris Dillon wrote:
>That isn't the problem.  You can sleep as much as you want between
>submitting the print jobs and the job order still gets munged.
>Even a job that at one time had #1 rank gets inverted and ends up
>with the lowest rank.

He's saying that you could work around the problem if the EARLIER
jobs had used a sleep between them, ie, so they do not have the
same last-mod time.  If they do not match, then the order will
not get confused when later jobs arrive.  What he is saying is
correct, even though it is not very useful in practice...  (his
work-around would have helped Lorenzo, but it is not practical
for your samba-server example).

>It appears that qsort() is the culprit.  In fact, here is an
>excerpt from the manpage:
>
>    The functions qsort() and heapsort() are not stable, that is,
>    if two members compare as equal, their order in the sorted
>    array is undefined.  The function mergesort() is stable. 
>

With the update I made, the sort will be stable because the two
filenames will not be equal.  Please try the update at:

http://www.freebsd.org/cgi/query-pr.cgi?pr=18361
      [PATCH] Fix for queue-ordering problem in lpr/lpd/lpq

or pick up the update from:
ftp://freefour.acs.rpi.edu/pub/bsdlpr/lpr_qfix.diff


---
Garance Alistair Drosehn           =   gad@eclipse.acs.rpi.edu
Senior Systems Programmer          or  drosih@rpi.edu
Rensselaer Polytechnic Institute


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?v04210107b535e522424f>