I think you're missing the point. The JVM can't know your intent when
you started your threads and cannot know that the right thing to do is
to 'level' resource usage across your threads. If you need your
threads to receive a more equal share of resources then this needs to
be expressed in your design. Hence the suggestion to use fair locks to
more precisely influence the scheduler.

Even the thread priority is not a hard and fast guarantee, just an
indication (or to quote a pirate: the code is more what you'd call
"guidelines" than actual rules). If you read a good Java certification
textbook it will tell you threads must have priorities, and that the
priority can be between 1 and 10, but it does not dictate what the JVM
should do about these different priorities. In general, scheduling
algorithms are left to the implementor, about the only thing you can
be certain of is that 1 is viewed as the lowest priority, 10 as the
highest and 5 as the default. Beyond that, all bets are off.

Phil.

On Nov 2, 2:32 pm, Brent <brent.r...@gmail.com> wrote:
> How does that look ok to you?  Threads 0 and 1 only executed 23 times
> while the other threads executed 45/46 times.  How can that ever be a
> good thing?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to javaposse@googlegroups.com
To unsubscribe from this group, send email to 
javaposse+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to