Definitely this. You should make a copy of the data you need on the main thread (i.e. in the AttachCapabilitiesEvent) and put that data into the map, if you can afford this. If it is too much data to copy you need to have thread safe data structures for all data that is accessed from both threads. Just "slapping synchronized on it" is usually not the right solution.