DUNE-DAQ / readoutlibs

readoutlibs
0 stars 2 forks source link

Synchronized thread start #12

Open roland-sipos opened 2 years ago

roland-sipos commented 2 years ago

Explore the possibility and implement a barrier with POSIX semaphores for synchronized component start/stop among readout modules in the readout app (A ReadoutSync plugin per readout app holds the barrier?)

Should we implement something like this in utilities?

philiprodrigues commented 2 years ago

@bieryAtFnal has been testing with multiple readout apps and the trigger chain, as have I, and I think that testing indicates that now is the time to solve this (difficult) problem.

I think we'll need this across readout apps, as well as within a readout app. That is, two readout apps replaying data should both replay the data for timestamp T at (approximately) the same time. This doesn't happen now because the two apps receive "start" at different wall-clock times (where the difference can be arbitrarily large), and they both start replaying the data at the same timestamp. I'm not sure of the solution - I suspect it is difficult, and will probably rely on assuming that the readout apps have access to ~synchronized clocks (which is a reasonable assumption on eg np04).