| ||||
Copyright 1999 Sams Publishing |
|
Chapter 7: Concurrent Access to Objects and Variables |
Overview |
When multiple threads are interacting with an object, controls need to be in place to ensure that the threads dont adversely affect one another. This chapter deals with issues that can introduce subtle errors in your application. An application that fails to safely control concurrent access can work properly most of the timemaybe nearly all the timebut will occasionally produce erroneous results. This makes the understanding and disciplined use of the information in this chapter critical to writing truly thread-safe applications that work properly all the time. |
In this chapter, Ill show you when and how to use the synchronized and volatile keywords to control concurrent access to objects and variables. |
| |||
Toc |