Is It Worth Detecting Concurrency?
Just a quick one: I have code that runs multiple threads and does a lot of thread-safe exchanges (in Windows, at the moment). But if the code is running on a system that cannot run threads independently (single core, no hyperthreading), is it worth detecting this condition and including a separate path that exploits this fact?
I don't know if using thread-safe exchange mechanisms (InterlockedExchangePointer() et. al) has a cost that could be optimised out, is all.