I'm wondering if this code will do any trouble:
I have a vector that is shared among many threads. Every time a thread has to add/remove stuff from the vector I do it under a synchronized
block. However, the main thread has a call:
System.out.println("the vector's size: "+ vec.size());
which isn't synchronized
.
Should this cause trouble?