I am setting up two threads for my application, and I am declaring a variable called x, which will be getting input from one thread and used in another thread for carrying out a function, as it is susceptible to change any time, I believe it has to be volatile and it needs to be global too. in this case can I declare a variable as static volatile x?
If yes, can someone shed some light on this ?