How JVM(JDK) split words?? Or is it just random splitting (because all threads are random)?
I don't understand output
You must be signed in to leave a comment
16 June 2021, 13:57
Randomness is not achievable with computers. It is an impossibility. A computer is just a bunch of algorithms, and if you take an algorithm and input the same exact variables into it you will get the same result every time. However, the variables that effect the algorithm that determines the amount of processor time each thread gets are so vast that it might as well be random. With that, you won't be able to determine which thread is asking for input at the time you input a String. It may be that one thread gets to read 2 threads in a row, or it may skip over one of the threads.