How do we verify that our code is thread safe? There is no easy answer to this question. Actually, there is no definitive answer to this question, either. Past a certain size, it’s impossible to prove with 100% certainty that a given portion of code will behave as expected if several threads access it simultaneously.