I know this is a dumb question, and I realize I should have figured this out when I started asm, but does the code execute in order, like the order that it is written in?
yes, except for "jumps" which (surprise!) jump to other place.
Well, starting from more or less Pentium Pro exists the posibility that the instructions are executed out of order, the final result is as if it was executed in order but some hardware could require exact order so you have to use serializing instructions to make sure that any pending memory access is commited so you can follow the next step.
And since Pentium processors many times adjacent instructions are executed in parallel but still the final result is the same as if the CPU was executed all the instruction sequentially one at a time.
And since Pentium processors many times adjacent instructions are executed in parallel but still the final result is the same as if the CPU was executed all the instruction sequentially one at a time.
yes, except for "jumps" which (surprise!) jump to other place.
And then we introduce multiple threads, and everything gets more complicated :)
Each thread still executes sequentially, though...
(and yeah, that doesn't change the fact that deadlocks and races are nasty).
(and yeah, that doesn't change the fact that deadlocks and races are nasty).
Thanks. :)
Watch out for SMC. That's when things may not executed as expected.