This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
hi! both treads increment i,k, and j in each of eternal loop invocation and return equal values. so letters printed if workWithoutLocks( ) executed between first and second variables increment , and it is possible without any legimitacy. see example 9.6 Mugal and Pasmussen cheers
I changed the line if (j1 != j2) System.out.println("j"); with if (j1 != j2) System.out.println(j1+"j"+j2); and found that the condition j1 != j2 is true after going through several loops .. It seems that after sometime one thread lags behind the other one