If I read the unique id from both plugins and make sure the are the same, how
big is the chance that the data does not match if I read them in two threads
(thread 1: the image, thread 2: the stats information)?
Would the situation improve if I can remove the gateway process?
The one thing that would remove the issue:
Use pvAccess, where the stats and the image are part of the same structure, and the client is guaranteed to get consistent updates.
If you are exporting into a different protocol anyway, the difference shouldn't be that much. In terms of being future-proof, it would be a big step forward.
Cheers,
~Ralph