[ltt-dev] [PATCH 12/12] centralize definition of BITS_PER_LONG

Mathieu Desnoyers compudj at krystal.dyndns.org
Thu Feb 18 11:09:34 EST 2010


* Paolo Bonzini (pbonzini at redhat.com) wrote:
> On 02/18/2010 02:46 PM, Mathieu Desnoyers wrote:
>>> >
>>> >  I32LLP64 is basically only Mingw64 and ia64-hpux.
>> And anyway I32LLP64 have 4-byte longs, so they should work anyway with
>> these tests.
>>
>>> >  They'd probably break
>>> >  horribly because with 99% likelihood somewhere there is an assumption
>>> >  that sizeof (long) == sizeof (void*).
>>
>> In the atomic ops headers possibly, yes.
>
> You couldn't use atomic op headers to exchange pointers too.  Maybe not  
> used by liburcu, but still a strong limitation.

Well the current atomic op headers are per-architecture. This should be
taken into account for the generic version you are proposing I guess.

>
> Some time we should also add double-long compare-and-swap, that's very  
> useful for lock-free lists.

Yes, good idea! Although this won't be available on all architectures.
We might have to think of a mutex-based compatibility layer for these.

Do you have pointers to papers describing this double-wide CAS
linked-list structure ? I wonder if we could use a clever RCU structure
to mimick the double-wide CAS.

Thanks,

Mathieu

>
> Paolo
>
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
>

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68




More information about the lttng-dev mailing list