I am wondering if this code will call:
I have a vector common to many threads. Every time a thread needs to add / remove material from a vector, I do it in a synchronized block. However, the main thread has a call:
System.out.println("the vector size: "+ vec.size());
which is not synchronized .
Should this cause problems?
java multithreading thread-safety vector
Guy Nov 01 '09 at 23:03 2009-11-01 23:03
source share