On May 15, 9:16 pm, Marco Versele <[email protected]> wrote:
> "For your own exercice" suggests:
> ModifyThreadGroupTest.javato create another (4th)SimpleThreadinstance using
> your capital city of your country.
> When doing so, I can see that the number of Threads and their names is
> displayed immediately - as expected- in the order the input was done.
> Then, the Thread itself displays a message when the Threads are DONE, but
> this is displayed in disorder. Why is that? Thanks for your clarifications.
There is no guaranty that because a thread is started first that it
will be run first. Suppose there are many intensive CPU calls
meanwhile, the thread may pass its turn and be pushed to the end of
the queue.
And finally all graphical calls are much slower than computing, so
that again, they can pass their turn.
Try it with forty threads and you will see that the threads are
starting in the order of the group, but not running in that order.
There is also no absolute guaranty that because you see the Done
message of thread x before the Done message of thread y, that the
thread x has been run before the thread y.
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---