On 2001-Jan-16 19:10:10 -0800, Alfred Perlstein <[EMAIL PROTECTED]> wrote:
>* Bruce Evans <[EMAIL PROTECTED]> [010116 19:03] wrote:
>> These don't use atomic operations (hint: no 64-bit atomic operations are
>> implemented on i386's).  If they need to be atomic, then they must use
>> locks.
>
>Just wondering, can't you use 'LOCK addl' and then use 'LOCK addc'?
>add longword, add longword with carry?  I know it would be pretty
>ugly, but it should work, no?

It's not an atomic update because each longword is being updated
independently:  A reader can access the object between the low
word and high word being updated and see an inconsistent result.

If you don't need to support multiple bus masters, then the best you
can achieve is: "di; addl; adcl; ei" - you don't need the lock
prefixes.  To support multiple masters, you need proper locks.  Since
SMP isn't supported on the 80386, as long as you don't to DMA to/from
64-bit objects you can get away with the "di; addl; adcl; ei"
sequence.

Peter


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to