Re: How to run tasks with priority?



Thanks Boudewijn,


Your sample is very helpful. But I think there is an issue in your sample,
which is that we must hardcode the number of sections that a code block
will be divided into. For example, in your sample, you hardcoded that Task1
is divided into 3 sections. I am wondering whether there are any approaches
which can flexibly define the number of sections in which a thread will be
divided into.

> To make the thread give away it's cycle to other
> threads with the same priority. In other words, to
> reduce the execution time without reducing the
> priority.

Are there any practical uses that we should give away it's cycle to other
threads with the same priority? Should we do it in this approach (yield)
manually or simply let JVM to do this.


Have a nice weekend,
George

--
Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-setup/200506/1
.



Relevant Pages

  • Re: Pinch points
    ... There are many occasions where it might be my priority, but where it would be stupid to assert my "right of way". ... This thread is now some 10 days old, and I have yet to see any mention of the cycle "bypasses" which are almost invariably provided at pinch points - Nottingham, for instance, says "traffic calming measures should be cycle-neutral". ... I passed 3 traffic throttles last night, 2 had cars parked so close to them that a bike woudn't have been able to use the "byepass", one had a kerb so high and a "byepass" so narrow that pedals would have hits kerbs, all were full of rubbish and glass. ...
    (uk.rec.cycling)
  • Re: Pinch points
    ... Show me, please, where there is any law stating that a cycle has ... There are many occasions where it might be my priority, ... But common sense and cyclists do not often go together. ... difficulty in seeing a driver coming the other way having a favourable ...
    (uk.rec.cycling)
  • Re: Pinch points
    ... If the OP had made use of the cycle "bypass" probably provided ... who could just as easily used the cycle bypass. ... excuse the driver (see the difference between "right of way" and ... priority he otherwise would have had. ...
    (uk.rec.cycling)
  • Re: Utterly amazing Paris commute video- filmed over one year.
    ... When a cycle lane crosses a junction, do cyclists have priority? ... However, good timing on the well presented vid, it was just a few days ...
    (uk.rec.cycling)