I have read many times that I should avoid shared state to avoid race conditions either in asynchronous programming or in multi threading.
So for example if I had a program that kept fetching data from external server and updated an object in memory and on user request I would send that object from memory.
How would I change the behaviour of such program to not use shared state?
I can't think of any way that makes sense. Have I misunderstood the idea of not using shared state?