¡@

Home 

java Programming Glossary: inciby5

Java: volatile boolean vs AtomicBoolean

http://stackoverflow.com/questions/3786825/java-volatile-boolean-vs-atomicboolean

show the difference for integers volatile int i 0 void incIBy5 i 5 If two threads call the function parallely i might be 5.. like this except you cannot synchronize on int void incIBy5 int temp synchronized i temp i synchronized i i temp 5 If you..

What is the difference of Atomic / Volatile / synchronize?

http://stackoverflow.com/questions/9749746/what-is-the-difference-of-atomic-volatile-synchronize

the Volatile works in following way volatile int i 0 void incIBy5 i 5 is equal to void incIBy5 int temp synchronized i temp i.. way volatile int i 0 void incIBy5 i 5 is equal to void incIBy5 int temp synchronized i temp i synchronized i i temp 5 I know.. volatile without synchronization 2 volatile int i 0 void incIBy5 i 5 The same problem as above even worse because i is not private..