Do I need a concurrent collection for adding elements to a list by many threads?
问题 static final Collection<String> FILES = new ArrayList<String>(1); for (final String s : list) { new Thread(new Runnable() { public void run() { List<String> file2List = getFileAsList(s); FILES.addAll(file2List); } }).start(); } This collections gets very big, but the code works perfect. I thought I will get a concurrent modifcation exception, because the FILES list has to extend its size, but it has never happened. is this code 100% threadsafe ? The code takes a 12 seconds to load up and a