Let's say there is a function(set of instructions foo()) which manipulates some data(global). Two threads are spawned by process each executing this function(foo()). How to handle concurrency and data protection (race condition) when these two thread executes at the same time on two different processor cores?
For concurrency and data protection, what are the main difference between single core and multi-core processor for above case?