Written May 15, 2013 All programs with concurrency have the same problem. Your program uses some memory: When your code is single-threaded, there's just one thread writing to memory. You are A-OK: But if you have more than one thread, they could overwrite each others changes! You have three ways of dealing with this problem: Locks Actors Software Transactional Memory I'll solve a classic concurren