[MDSAL-391] Reconsider augmentation tracking in DataObjectCodecContext Created: 14/Nov/18  Updated: 22/Nov/18  Resolved: 19/Nov/18

Status: Resolved
Project: mdsal
Component/s: Binding runtime
Affects Version/s: None
Fix Version/s: Fluorine SR2, 3.0.2

Type: Improvement Priority: Medium
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

We are currently using ConcurrentMap to track by{Stream,Yang}Augmented. The access pattern is heavily biased towards lookups, which, being concurrent, involve volatile reads.

The only way this map can change is through reloadAugmentations(), hence it would seem we could use either an ImmutableMap or a HashMap with copy-on-write.

Doing so would incur a single volatile read to acquire the map, but the code paths need to be analyzed to make sure reloadAugmentations() does not incur side-effects, leading to re-enters, AB-BA deadlocks or iteration visibility changes.


Generated at Wed Feb 07 20:09:41 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.