Cost of Volatile variables?

Very simple Arduino implementation of workload bound to a thread:

ESP32 - using 2nd core - Using Arduino / Programming Questions - Arduino Forum