PcloudStimProd: make sh_ptrs to Pcloud*StimBuff atomic<>
This change is a bit pedantic, but since these vars aren't accessed in any hotpath, it's fine to be pedantic. We made these sh_ptrs atomic so we can use acquire and release side effects when loading and storing them. This doesn't eliminate the problem of seeing inconsistent state across microcontrollers, but it helps with simple accesses like these ones we already do.
This commit is contained in:
@@ -99,10 +99,3 @@ cancelation problem described above, concerning
|
||||
StimulusBuffer::start/stop(), and ensuring that after
|
||||
stop() has returned, we can be reasonably sure that all
|
||||
in-flight ops have exited.
|
||||
|
||||
Making sh_ptr<StimulusBuffer> atomic for mem barriers:
|
||||
We could also complete our implemetation's correctness by converting
|
||||
the sh_ptrs to StimulusBuffer inside of the PCloudStimulusProducer
|
||||
into std::atomic<std::shared_ptr<StimulusBuffer>>, and using
|
||||
std::memory_order_release/memory_order_acquire when writing and
|
||||
reading them respectively.
|
||||
|
||||
Reference in New Issue
Block a user