Abstract
In the last two chapters, we looked at numerous ways of starting work that will run asynchronously. However, in all of the examples, that work has been relatively self-contained. Asynchrony opens up a whole new class of bugs that can infect your code: race conditions, deadlocks, and data corruption to name just three. We will look at how you debug asynchronous code in Chapters 15 and 16, but our starting point has to be how to prevent these issues in the first place. In this chapter, we will examine the need for thread safety and then introduce the primary tools used to achieve it. In Chapter 5, we will take this idea further and look at the constructs introduced in .NET 4.0 that take some of the work off our shoulders.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2013 Richard Blewett
About this chapter
Cite this chapter
Blewett, R., Clymer, A. (2013). Basic Thread Safety. In: Pro Asynchronous Programming with .NET. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-5921-3_4
Download citation
DOI: https://doi.org/10.1007/978-1-4302-5921-3_4
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4302-5920-6
Online ISBN: 978-1-4302-5921-3
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)