At the moment the implementation of PersistentDataStorage is somewhat bad, I had to hack it in a big hurry during precious ELBE beam time. Right now, it is not properly implementing the data exchange between the thread calling PersistentDataStorage::updateValue() and the thread periodically writing out the data. It works because on a time scale of 30 seconds (the periodicity of writing out the data) the data will be visible to other threads even without a memory barrier - but of course this is not the way to do it.
This should be fixed by using an atomic triple buffer. Also the periodicity should be configurable and not hard-coded to 30 seconds.
At the moment the implementation of
PersistentDataStorage
is somewhat bad, I had to hack it in a big hurry during precious ELBE beam time. Right now, it is not properly implementing the data exchange between the thread callingPersistentDataStorage::updateValue()
and the thread periodically writing out the data. It works because on a time scale of 30 seconds (the periodicity of writing out the data) the data will be visible to other threads even without a memory barrier - but of course this is not the way to do it.This should be fixed by using an atomic triple buffer. Also the periodicity should be configurable and not hard-coded to 30 seconds.