educative.io

Collections in Java Course

CopyOnWriteArrayList in Java -

Not very descriptive. It just give us overview. There are multiple questions arises while studying the course.
like -

  • How newly array or back Array get synchronized ?
  • What happen when multiple operations running in multiple thread ?

etc etc.

Please help to enhance the content of Java Collections Course

Thanks

For the second point: thread safety is achieved by creating a separate copy of the underlying array. All mutative operations result in a separate array copy and are executed on it.

As for the ConcurrentModificationException, it is avoided because the operations happen on one copy of the list while the iterator is iterating over a separate copy.

But you are correct, the lesson does skip over some details.

1 Like