Signed-off-by: Dileep Kumar Somajohassula dileepharithasa@gmail.com - Replace HashMap with ConcurrentHashMap for producer and consumer#3200
Conversation
binding registries, and use CopyOnWriteArrayList for consumer binding lists to prevent concurrent modification issues during bind, unbind operations and concurrent iteration.
|
Hello @olegz and team, Could you please review this PR when you have a chance? This change makes the BindingService registries thread-safe by replacing HashMap with ConcurrentHashMap and using CopyOnWriteArrayList for consumer binding lists. Thank you! |
|
Hello @olegz and team, Could you please review this PR when you have a chance? Thanks |
|
Unfortunately |
Thanks for the feedback. Could you provide more details on the performance concerns with ConcurrentHashMap in this context?
The proposed solution: My understanding is that these binding registries are relatively small and are accessed concurrently by multiple threads. In this case, correctness and thread safety would seem more important than the relatively small overhead introduced by ConcurrentHashMap. Unless there is profiling or benchmark data showing a measurable regression in this specific scenario, it may be difficult to assess the significance of the performance concern. |
Signed-off-by: Dileep Kumar Somajohassula dileepharithasa@gmail.com -binding registries, and use CopyOnWriteArrayList for consumer binding lists to prevent concurrent modification issues during bind, unbind operations and concurrent iteration.