- thread writes are not instantly visible to other threads by default. solved by volatile or synchronized compiler and CPU optimisations JIT compiler reordering. out-of-order execution. order of processor write buffer flush. solved by volatile or synchronized race conditions multiple threads are competing over the same resource when order of the access is significant. solved by synchronized or volatile + CAS Problems in concurrent programs
program is non-deterministic because it depends on execution schedule of threads region of code concurrently modified by multiple threads when code or data structure is free from race conditions in a multithreaded program
write operations. At the end of commit block - all the writes are committed. In case of transactional conflict - the transaction is rolled back. Transaction is completed if it was committed or rolled-back and re-executed.