Sollicitatievraag bij Selerity

How would a compiler optimize this code? Concurrency problems. How would you implement this specific system (relevant to the position - pretty sure it varies).