Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #6876

Re: A quota based lock

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Robert Klemme <shortcutter@googlemail.com>
Newsgroups comp.lang.java.programmer
Subject Re: A quota based lock
Date Mon, 08 Aug 2011 21:46:27 +0200
Lines 37
Message-ID <9aasp0F9v2U1@mid.individual.net> (permalink)
References <83f81158-8aee-486d-a51b-c0f7dfdbb0da@h25g2000prf.googlegroups.com> <j1oj30$tut$1@dont-email.me> <j1p40f$jua$1@dont-email.me> <j1p4n8$pog$1@dont-email.me> <j1pago$8ua$1@dont-email.me> <j1pbj1$hvd$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net UDGbQTIfkXxJZoCNAPbg+w22IfIwPEz1Wy0ozVtJcbAKPcG6c=
Cancel-Lock sha1:T1Qx95v6GuboNfFTlFH4QRjdobA=
User-Agent Mozilla/5.0 (Windows NT 6.0; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0
In-Reply-To <j1pbj1$hvd$1@dont-email.me>
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6876

Show key headers only | View raw


On 08.08.2011 20:57, markspace wrote:
> On 8/8/2011 11:39 AM, Knute Johnson wrote:
>
>> 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.
>
>
> A simple priority system might involve multiple queues, where the high
> priority queues are serviced X times more than the lower ones.
>
> E.g., two queues. Queue A gets 10 jobs executed for each 1 job that
> queue B gets executed. But because queue B is always guaranteed to be
> serviced eventually, there is no starvation.
>
> This is a simple step up from round-robin service (which is what Eric
> proposed). There are many algorithms existing. Check out any text on OSs
> and job scheduling.

Another idea would be to take the time a task has access to the 
resource, sum up per task category and for the next task pick the first 
one from the category which is furthest below its specified share 
(percentage).  Basically your approach measures executions and this 
approach measures actual resource usage time.

An interesting thing to learn would be whether tasks are simply executed 
by threads calling a method or whether tasks can also be submitted (e.g. 
as Runnable or similar).  That would also affect the internal layout and 
the way scheduling could be done.

Kind regards

	robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

A quota based lock Robert Stark <panxiaozhong@gmail.com> - 2011-08-08 00:13 -0700
  Re: A quota based lock Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-08 07:58 -0400
    Re: A quota based lock Knute Johnson <september@knutejohnson.com> - 2011-08-08 09:48 -0700
      Re: A quota based lock markspace <-@.> - 2011-08-08 10:00 -0700
        Re: A quota based lock Knute Johnson <september@knutejohnson.com> - 2011-08-08 11:39 -0700
          Re: A quota based lock markspace <-@.> - 2011-08-08 11:57 -0700
            Re: A quota based lock Robert Klemme <shortcutter@googlemail.com> - 2011-08-08 21:46 +0200
              Re: A quota based lock Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-08 20:41 -0400
                Re: A quota based lock Robert Klemme <shortcutter@googlemail.com> - 2011-08-10 09:36 +0200
                Re: A quota based lock Robert Stark <panxiaozhong@gmail.com> - 2011-08-10 04:40 -0700
                Re: A quota based lock Robert Klemme <shortcutter@googlemail.com> - 2011-08-10 18:55 +0200
                Re: A quota based lock Martin Gregorie <martin@address-in-sig.invalid> - 2011-08-10 19:26 +0000
                Re: A quota based lock Patricia Shanahan <pats@acm.org> - 2011-08-10 12:37 -0700
                Re: A quota based lock Robert Stark <panxiaozhong@gmail.com> - 2011-08-10 18:30 -0700
                Re: A quota based lock markspace <-@.> - 2011-08-10 19:17 -0700
                Re: A quota based lock Robert Klemme <shortcutter@googlemail.com> - 2011-08-11 12:32 +0200
          Re: A quota based lock Tom Anderson <twic@urchin.earth.li> - 2011-08-09 21:00 +0100
  Re: A quota based lock markspace <-@.> - 2011-08-08 07:58 -0700
  Re: A quota based lock Tom Anderson <twic@urchin.earth.li> - 2011-08-09 21:45 +0100

csiph-web