I have a thread that captures controller input. This is the only thing this thread does - it calls XInputGetState()
every x milliseconds and stores the result in a synchronized circular buffer. I have another thread that reacts to this input by vibrating the controller via XInputSetState()
when a certain condition has been reached.
In other words, one thread only ever calls XInputGetState()
, while the other thread only ever calls XInputSetState()
. Theoretically, there can be no point at which either function is being called multiple times simultaneously. Is it still unsafe to do this without synchronization?
Note: These two functions work on an entirely different set of data, but the implementation most likely reads/writes to something that isn't synchronized.