I have a List objects that are regularly updated from multiple threads. During the update, I want to use a stream to filter some elements.
For instance; I have a list that is regularly updated:
List<MyObject> myList
Now at some point in time I use the stream in this list
List<MyObject> result = myList.stream().filter(myobj->myobjt.isValid()).collect(toList());
Is this thread safe considering my list is being updated from multiple threads?
source share