I have a thread that continuously read a global variable and there is another thread that occasionally update (write) global variable. What could be the best way to do that and what would be the cost? Is it possible if I do not put lock on read side and put a lock in writer side?
Thanks