Java Synchronized list

后端 未结 7 2121
一整个雨季
一整个雨季 2020-12-01 06:13

I have a pre-populated array list. And I have multiple threads which will remove elements from the array list. Each thread calls the remove method below and removes one item

7条回答
  •  既然无缘
    2020-12-01 06:33

    It will give consistent behavior for add/remove operations. But while iterating you have to explicitly synchronized. Refer this link

提交回复
热议问题