I have a UDP thread which is maintaining an int variable '__counter' of number of packets arrived , and a manger thread which needs to read this __counter variable and just print it on the log file.
Im not required for timely update reads means I am allowed to get old or new __counter variable. Its just printing it on logs.
For this "_counter" shared variable which is of type uint_32 , do I need to wrap it inside std::atomic<> ?
Can I use it as a normal variable and share it between threads because I dont need timely read? Do I need to care about cache sizes or something ?