When passing objects between threads, you will have to pay attention that these objects are not manipulated by two threads at the same time. An example would be a implementation whose key/value pairs are modified by two concurrent threads. In order to avoid problems with concurrent modifications you can design an object to be immutable.
Java Interview Java Script
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment