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?
Posted on 2008-01-17 20:04:55 by HKothari
yes, except for "jumps" which (surprise!) jump to other place.
Posted on 2008-01-17 20:30:17 by vid
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.
Posted on 2008-01-17 20:48:27 by LocoDelAssembly

yes, except for "jumps" which (surprise!) jump to other place.
Haha! Yes, I knew that part, thanks. :D
Posted on 2008-01-17 20:58:29 by HKothari
And then we introduce multiple threads, and everything gets more complicated :)
Posted on 2008-01-18 00:46:55 by Homer
Each thread still executes sequentially, though...

(and yeah, that doesn't change the fact that deadlocks and races are nasty).
Posted on 2008-01-18 04:25:21 by f0dder
Thanks. :)
Posted on 2008-01-18 05:21:22 by HKothari
Watch out for SMC. That's when things may not executed as expected.
Posted on 2008-01-19 11:26:34 by XCHG