I created four threads.
When the code runs, I see:
Thread-0 is running.
Thread-1 is running.
Thread-2 is running.
Thread-3 is running.
Yet, when the code executes, all of Thread-0 runs first, then Thread-1 and so on.
Since I have a multi-core machine, I expected to see the
thread numbers jumbled up to show that multiple threads were running at the same time, but that doesn't appear to be happening.
I am not using ".join()".
Just creating four threads and starting them, like this:
(Hard-coded loop is only for
testing)
I've done some searching on this but it's still not clear.
Is creating threads enough to have the system execute them in parallel or do I really need to use fork-join framework?
Thanks,
-- mike