The title is the question: when a thread exits, does its cached memory get flushed to the main memory?
I am wondering because cases are common where the main thread creates some threads, they do some work on independent parts of the array (no data dependencies between each other), the main thread joins all the worker threads, then does more calculations with the array values that result from the worker threads computations. Do the arrays need to be declared volatile
for the main thread to see the side-effects on it?