I came across a situation where multiple threads were attempting to display a loading view. This was sometimes causing race conditions. Enter synchronization. This article does a great job of explaining various techniques for performing synchronization. Because I was working with with UI components,