Mutex: Difference between revisions
Content added Content deleted
Puppydrum64 (talk | contribs) |
Puppydrum64 (talk | contribs) m (→{{header|8086 Assembly}}: added an additional example and deleted a statement I'm not sure about) |
||
Line 30: | 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. |
* 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. |
* <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> |
<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> |
lock dec byte ptr [es:di]</lang> |
||