Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Lock-free ring buffer memory barriers test case

1 view
Skip to first unread message

Olivier Guilyardi

unread,
Oct 29, 2008, 7:15:23 AM10/29/08
to
Hi,

Can any of you advise a good test case that would demonstrate memory
barriers are needed in a lock-free ring buffer ? I mean: a piece of
code that would fail because memory barriers are missing.

I wrote the following test, and it succeeds on PowerPC SMP (dual IBM
Cell system QS-20), which is supposed to have weak memory ordering:

http://svn.samalyse.com/misc/rbtest/test-int-array.c

It is part of a (4 implementations) ring buffer test suite, that one
can run with:

svn co http://svn.samalyse.com/misc/rbtest
cd rbtest
make test

Best regards,

--
Olivier Guilyardi / Samalyse

0 new messages