RFR: 8323670: A few client tests intermittently throw ConcurrentModificationException
Tejesh R
tr at openjdk.org
Mon Jan 22 08:36:26 UTC 2024
On Mon, 22 Jan 2024 07:39:04 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:
>> Yes, which is why I am using Synchronized to handle `concurrentModificationException`.
>
> It doesn't work like this. Modification happen in another thread in another method. This `synchronized` doesn't affect another method.
"_Synchronized methods enable a simple strategy for preventing thread interference and memory consistency errors: if an object is visible to more than one thread, all reads or writes to that object's variables are done through synchronized methods_" as per this statement from the doc ([Synchronized Methods](https://docs.oracle.com/javase/tutorial/essential/concurrency/syncmeth.html)) it should be handled right?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17462#discussion_r1461496876
More information about the client-libs-dev
mailing list