Re: Simple Flag on SMP
From: Frank A. Uepping (null.0.fau_at_spamgourmet.com)
Date: 11/05/03
- Next message: Bruce Ding: "Still, the question is about the relationship among hardware, firmware and driver"
- Previous message: Frank A. Uepping: "Re: Simple Flag on SMP"
- In reply to: Neil Horman: "Re: Simple Flag on SMP"
- Next in thread: Pete Zaitcev: "Re: Simple Flag on SMP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 05 Nov 2003 20:46:21 +0100
Neil Horman wrote:
> Frank A. Uepping wrote:
>> Neil Horman wrote:
>>
>>
>>>Tuukka Toivonen wrote:
>>>
>>>>In article <bo8f6c$1u2$1@stan.redhat.com>, Neil Horman wrote:
>>>>
>>>>
>>>>>>volatile is to weak for SMP, is that true?
>>>>>>What are other alternatives to volatile?
>>>>>
>>>>>not at all portable. If you want to guarantee it, you need to use
>>>>>mutexes or semaphores to protect your data.
>>>>
>>>>
>>>>Strange that I haven't noticed anyone yet mentioning functions
>>>>in <asm/atomic.h>, such as
>>>> * atomic_sub - subtract the atomic variable
>>>> * atomic_add - add integer to atomic variable
>>>>etc...
>>>
>>>Those'll work perfectly well too. ;)
>>>Neil
>>>
>>
>> Has the atomic_t the effect of a memory barrier()?
>> I mean, does an atomic_t ensures that a modification of data gets
>> immediately visible to the CPUs?
>>
>> /FAU
>>
>>
> It has to. Otherwise atomic variable would be broken on SMP systems.
Consequently, spinlocks and other synchronizing mechanisms behave so too.
/FAU
- Next message: Bruce Ding: "Still, the question is about the relationship among hardware, firmware and driver"
- Previous message: Frank A. Uepping: "Re: Simple Flag on SMP"
- In reply to: Neil Horman: "Re: Simple Flag on SMP"
- Next in thread: Pete Zaitcev: "Re: Simple Flag on SMP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|