I have the following two datastructures:

```
// Session -> Symbol -> ID
Map<String, Map<String, Long>> mapping1;
// Symbol -> ID -> Level -> Value
Map<String, Map<Long, Map<Integer, Double>>> mapping2;

```

and the following methods:

```
void addSession(String session, String symbol, Long id) {
    mapping1.computeIfAbsent(session, k -> new HashMap<>())
        .put(symbol, id);
}

void removeSession(String session, String symbol, Long id); // similar to above

void addValue(String symbol, Long id, Integer level, Double value) {
    mapping2.computeIfAbsent(symbol, k -> new HashMap<>())
        .computeIfAbsent(id, k -> new HashMap<>())
            .put(level, value);
}

Double getValue(String session, String symbol, Integer level) {
    int id = mapping1.get(session).get(symbol);
    return mapping2.get(symbol).get(id).get(level);
}

```

Now the issue is, we have 1 thread that is doing all the writing (add/removeSession and addValue), and 1 thread that is doing all the reading (getValue). The writes heavily outweigh the reads.

Expected call count:

* add/removeSession - a few times a day
* addValue - ~100 a second
* getValue - every few seconds

Given this, I'm wondering what would be the best way to synchronise these 2 threads without using a lock? I'm trying to figure out a way of flattening all the data into a single map but can't seem to think of anything.

EDIT: to make clear. We want to synchronize access to the Value in mapping2. This can be updated 100s of times in a second.