From owner-freebsd-hackers Wed May 3 7:31: 5 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.100.7]) by hub.freebsd.org (Postfix) with ESMTP id 80D4937B992 for ; Wed, 3 May 2000 07:30:59 -0700 (PDT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.acs.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.9.3/8.9.3) with ESMTP id KAA372354; Wed, 3 May 2000 10:30:46 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: References: Date: Wed, 3 May 2000 10:30:43 -0400 To: Chris Dillon , Dan Nelson From: Garance A Drosihn Subject: Re: PROBLEM FOUND (sort of): Re: lpr: order of print requests Cc: freebsd-hackers@FreeBSD.ORG Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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