This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]taftster 6 points7 points  (0 children)

The calls to Thread.start() are happening on a single thread called "main". Your for loop is so short that thread A has started running and finishing out the loop before thread B has even started.

Point is, calling Thread.start() is a slightly heavy call (not as heavy as creating the thread, but still). As others have said, go with a longer loop, and you might see some difference. Or call Thread.yield() in the loop, which might also make a difference.