This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Generic function descriptor


> #ifndef COMPARE_AND_SWAP
> #define COMPARE_AND_SWAP(ptr,old,new) \
>   atomic_compare_and_exchange_bool_acq ((ptr), (old), (new))
> #endif

I've looked at various implementations of this for HPPA (atomicity.h),
and the only truly atomic way is through a light-weight syscall (same
way we set our thread pointer in INIT_THREAD_SELF). Though I should
probably think about this more since it really not optimal. Any
recommendations are more than welcome.

Lockfree Queue Algorithm using singly-linked lists:
http://www.cs.rpi.edu/pub/valoisj/tr94-17.ps.gz

Describes a method for insert/delete from a table using CAS as you
outline here. 

For those with ACM access...
High performance dynamic lock-free hash tables and list-based sets:
http://doi.acm.org/10.1145/564870.564881

c. 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]