[cpp-threads] Alternatives to SC

Chris Thomasson cristom at comcast.net
Wed Jan 17 21:13:17 GMT 2007


> Peter Dimov wrote:
>> Doug Lea wrote:
>>
>>> Atomics can be used to create SC constructions like locks.
>>> But atomics can also be used in other ways that are not necessarily
>>> SC. As it turns out, all usages on cache-coherent causally consistent
>>> machines are at least nearly SC.
>>
>> Isn't it true that most usages are PC?
>
> At least some versions of PC (Program consistency) are among
> those models that might, under the right interpretation, be
> equivalent to CCCC. I have a list of five in this category.
> The main reason for taking the risk to name yet another memory
> model is that none of them seem to bear uncontroversial interpretations
> that would allow clear use as language-level memory model.
>
>>  Do we really need the #StoreLoads? :-)

You need #StoreLoad for hazard pointer loads... That means mfence on x86... 
However, you can always use Joe Seighs SMR+RCU which can eliminate the need 
for the expensive barrier...

>> Speaking of hazard pointers...

[...]

>
> Continuing your aside-mode: I agree that for C++, it would be great
> to have a pre-supplied library component or two to handle hazard
> pointers, because they are very hard to program.

FWIW, here is a full-blown prototype of hazard pointers:

http://appcore.home.comcast.net/
(this is all my work...)


http://atomic-ptr-plus.sourceforge.net/
(this is Joes excellent work...) 




More information about the cpp-threads mailing list