Mutex: Difference between revisions

235 bytes removed ,  2 years ago
m
→‎{{header|8086 Assembly}}: added an additional example and deleted a statement I'm not sure about
m (→‎{{header|8086 Assembly}}: added an additional example and deleted a statement I'm not sure about)
Line 30:
* You cannot <code>LOCK</code> registers (unless they are in brackets). This makes sense - each processor has its own registers and they can't access each others' registers anyway.
* <code>LOCK</code> can't be placed in front of any instruction on the 8086, only ones where it actually applies.
* There is no way to keep a <code>LOCK</code> active for a fixed amount of time or machine instructions. If you have several instructions in a row that need to be <code>LOCK</code>ed, you must <code>LOCK</code> each one individually.
 
<lang asm> lock inc word ptr [ds:TestData] ;increment the word at TestData. Only this CPU can access it right now.
lock dec byte ptr [es:di]</lang>
 
1,489

edits