I am reading from multiple files concurrently, and all of those files are adding elements to the same list.
Up till now I used a regular ArrayList, but as I understood I am actually suppose to be using CopyOnWriteArrayList in order to make my code thread safe.
Problem is, the thread safe list is copying the list on each add, and since I performing a lot of single elements adds I may run in some performance issues.
Since I am only adding to the list, and I only use it's contents after the entire files were read, hence all of the elements were added - is it possible to still use a regular ArrayList, or I may encounter some unexpected behaviour?