--- In javajousters@yahoogroups.com, "Leonardo Boselli" <boselli@...>
wrote:
> I tried comparisons a lot of years ago and the behaviors of threads
were
> very different. Now they could be more uniform.
Possibly. They still seem to be different in various ways which make
using thread priorities very difficult, if not impossible. see
http://cs-people.bu.edu/sowmya/htdocs/threadsTest.html for some
interesting graphs. Sometimes the lower priority threads actually get
more cpu time!
In fact, I see that the threading model of the JVM doesn't guarantee
that the thread priorities actually have any effect, and states that
they shouldn't be relied on for any algorithmic use. Thus any
solution to this problem shouldn't use them.
Also there is no guarantee of the thread implementation using
timeslicing, so it really shouldn't be relied on either. Thus the use
of yield() in the current implementation is correct and necessary.
>Anyway, because of time
> constraints, I think that, for the moment, it's better to remove the
jtobots
> that slow down the simulation and ask to their authors to fix their
code.
OK. I see that this has been done already, and that TTL has been fixed.
> In the meantime, if you have modified the code of the simulator
(using API
> compatible with older versions of the JDK), feel free to send it to me
> (please, mark clearly the changes, thank you in advance!)
I don't have anything at the moment, but I may do in the future. Thanks.
Cheers, Tim.