LOCK instruction (x86 assembly)

Programming, for all ages and all languages.
Post Reply
sith

LOCK instruction (x86 assembly)

Post by sith »

Hi,

does the LOCK instruction has any meaning in a single-processor system ? Or is only used in SMP-systems ?

What happens if a taskswitch occurs right after a LOCK instruction ?

Thnx,

Jeroen
Tim

Re:LOCK instruction (x86 assembly)

Post by Tim »

sith wrote:does the LOCK instruction has any meaning in a single-processor system ? Or is only used in SMP-systems ?
It's not necessary on a single-processor system.
What happens if a taskswitch occurs right after a LOCK instruction ?
Nothing unusual... why? LOCK is an instruction prefix, not an instruction in its own right, so it won't get separated from the instruction itself.
Post Reply