Hello,
please consider this
thread:
C:\Java\EigeneJavaProgramme
java Test34
MAIN-METHOD 0
MAIN-METHOD 1
.............
MAIN-METHOD 227
THREAD 0
THREAD 1
........
THREAD 1999
MAIN-METHOD 229
.........
MAIN-METHOD 2999
When I start the programm all over again it prints:
C:\Java\EigeneJavaProgramme java Test34
MAIN-METHOD 0
MAIN-METHOD 1
.........
MAIN-METHOD 348
THREAD 0
THREAD 1
.........
THREAD 1999
MAIN-METHOD 349
.........
MAIN-METHOD 2999
Therefore two questions about Thread behavour:
1. Why this difference in the execution time?
In the second run of Test24 it seems the computer gives the main method
more execution time than before.
2. What about the interaction of Thread and main. It seems that the start of
A thread interrupts main() for the time a thread is fully executed. Why
isn’t there a switchback from main to Thread from Thread to main etc.
it is only main() – Thread interrupts main until finished – programm main
continues.
Thanks for your answers.
Thomas