I'm trying to write a program in C++ with one global variable is read by multiple threads and updated by one thread. In this case do I need to write any semaphore like things or can I just leave it as is since only 1 thread is actually writing to the global variable so there is no possible race conditions.
Also Im a newbie in semaphore so I need to spare myself the hassle if possible.
The program is this: writer thread: check pin constantly for high voltage, set global variable when it is high
reader threads: constantly check global variable in infinite loop and do something when it is set.