> The thing about speculative execution and out of order execution to remember is that you always get the expected result from a single threaded perspective.
Could you elaborate on this? I thought at least speculative execution was handled internally in the CPU and essentially not visible to the user apart from the performance impact?
Iām not sure what you refer to as out-of-order execution, is this execution reordering within the C compiler?
> If you throw in interrupts or threads, you know you must tread cautiously in C.
Naturally, yes.
Re:The cost of forsaking C
by vkuruthers on Wednesday October 05, 2016 @09:20AM
(#12643539)
Ahh, blaming the hardware. A sure sign they haven't looked into their code closely.
Re:The cost of forsaking C
by johncolanduoni on Wednesday October 05, 2016 @09:10AM
(#12643474)
You're right as far as results, but both can still mess significantly with performance even when everything is single threaded.
Few things have made me more nervous in my career than seeing a ISR making use of C++ standard library features. When I asked the engineer how they were sure this was safe and worked under the covers, I was immediately dismissed as "the compiler takes care of all that." The project only ever worked at -O0 and was still buggy. The engineer blamed the hardware.