Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Knute Johnson Newsgroups: comp.lang.java.programmer Subject: Re: A quota based lock Date: Mon, 08 Aug 2011 11:39:41 -0700 Organization: A noiseless patient Spider Lines: 24 Message-ID: References: <83f81158-8aee-486d-a51b-c0f7dfdbb0da@h25g2000prf.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 8 Aug 2011 18:39:20 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="mz/LDSJwiWnk3Jnnqg7x+Q"; logging-data="9162"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19SHpc5hhs4E32KuLIQMSMm" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20110624 Thunderbird/5.0 In-Reply-To: Cancel-Lock: sha1:B4IF1FlsviiLkHLCw0zMEduozWk= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6874 On 8/8/2011 10:00 AM, markspace wrote: > On 8/8/2011 9:48 AM, Knute Johnson wrote: >> >> I like that idea with a twist, have the higher priority jobs get put in >> the queue closer to the top. > > > No, see this is why "one little twist" doesn't work. Higher priority > jobs will then starve out the lower priority jobs if there are enough of > them. Putting them in "closer" will bump them ahead of other jobs, which > may stay permanently in the back of the queue if there are enough bumps. > > > FIFO scheduling is best until you figure out something else that > actually works. Perturbing that FIFO algorithm isn't likely to work and > will cause starvation, as noted above. > No priority scheme will ever be truly fair. I'll bet you could get pretty close without being too complicated. I'll think about it some more. -- Knute Johnson