Tuesday, July 15, 2003 02:44 AM
Synchronization addresses the issue of shared memory access, and therefore should only be used for this purpose. This includes accessing same data from different methods in the same object, aswell from the same method. Local variables defined within the method are stack based and therefore implicitly thread-safe - separate threads get different variables. Keep synchronized blocks to an absolute minimum, they impact performance.