Previous code is like; to avoid ConcurrentModificationException on a Vector; where ever iteration is required; it was performing inside synchronized block on that Vector. So It is hitting very poor performance by making multiple threads into BLOCKED state to acquire lock on that Vector at different APIs.
I have decided to replace Vector
to Collections.newSetFromMap(new ConcurrentHashMap<psConference,Boolean>());
in my project.
So after changing Vector into Concurrent collection; i have removed all SYNCH blocks.
But the problem here is some of my code is performing clone() on that Vector.
- How to do the same on here since i have only Set interface ?
- Vector clone() is Deep cloning or Shallow cloning ?
- Also pls tell me the significance of Boolean at
ConcurrentHashMap<psConference,Boolean>