TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Craig Swanson
from: Detlef Engert
date: 1996-02-01 22:06:52
subject: mutex semaphores

Hello Craig!

Thus quoth Craig Swanson to Mike Bilow:
 CS>     LOCK
 CS>      (or can it?)
 CS>     DEC   [EAX]

There is no chance for an interrupt to happen at the location in your
example, since LOCK 
isn't an instruction but an instruction prefix. An instruction is scheduled
at the same 
time with all of its prefixes. So there is absolutely no need for a CLI/STI guard.

There is another problem with your example code. Excerpt from the TASM 3.0
quick reference 
guide:
' Locked access is *not* assured if another CPU is executing an instruction
concurrently 
that has one of the following characteristics:
 - Is not preceded by a LOCK prefix
 - Is not one of the instructions which may have an LOCK prefix (or have it
implicitly)
 - Specifies a memory operand that does not exactly overlap the destination operand.
   Locking is not guaranteed for partial overlap, even if one memory
operand is wholly
   contained within another.'

bye, Detlef

 ! mailto engert{at}ibm.net, 2:2490/2576.1{at}fidonet
--- Sqed/32 1.00/r00108
* Origin: Nachtigall/2, Nuernberg/Germany, +49-911-861319 (2:2490/2575.2)
SEEN-BY: 50/99 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809
@PATH: 2490/2575 2501 1050 1601 2444/4000 24/999 2/777 396/1 270/101 712/515
@PATH: 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.