The result will be so unpredictable that even the unpredictability is unpredictable. It depends a lot on how the OS schedules your threads. It may do the same thing every time, or it may do a different thing every time. It depends on what else is going on in the system, how many CPUs there are and so on.
Matheus Souza wrote:
I don't think that the x variable is shared. It's not an static, so it's an instance variable, isn't it?
x variable is shared because all threads are using the same instance of runnable.