In thread-safe collection classes (i.e. Vector) , all the state variables are guarded by the object's intrinsic lock.
They encapsulate all the mutable state within an object and protect it from concurrent access by synchronizing methods which access mutable state.
Only mutable data is guarded by locks.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.