Olivier Guilyardi wrote:
To figure whether memory barriers are needed or not,
we need to run the test on
various architectures.
For this purpose, I've set up a small svn repo with everything to run the test
easily. There's no dependency, you just need pthread, gcc and sh.
Here's how to run the test:
svn co
http://svn.samalyse.com/misc/rbtest
cd rbtest
make test
i don't really understand the finer points of this discussion, but hey
it's always great to join a technical thread. my favourite bikeshed
color is yellow :-D
ok, here comes the result for a single-cpu athlon64 4000+ in 64bit mode.
nettings@kleineronkel:/build/rbtest> make test
gcc -Wall -I. -I./jack -lpthread -o test-int-array-jack \
test-int-array.c jack/ringbuffer.c
test-int-array.c: In function ‘main’:
test-int-array.c:101: warning: format ‘%d’ expects type ‘int’, but
argument 2 has type ‘long unsigned int’
gcc -Wall -I. -I./portaudio -lpthread -o test-int-array-portaudio \
test-int-array.c portaudio/ringbuffer.c
portaudio/pa_ringbuffer.c
test-int-array.c: In function ‘main’:
test-int-array.c:101: warning: format ‘%d’ expects type ‘int’, but
argument 2 has type ‘long unsigned int’
gcc -Wall -I. -I./portaudio -lpthread -o
test-int-array-portaudio-nobarrier \
-DNO_MEMORY_BARRIER \
test-int-array.c portaudio/ringbuffer.c
portaudio/pa_ringbuffer.c
test-int-array.c: In function ‘main’:
test-int-array.c:101: warning: format ‘%d’ expects type ‘int’, but
argument 2 has type ‘long unsigned int’
./alltests.sh
Starting ringbuffer tests (buffer size: 512)
=== Jack ringbuffer test ===
starting ringbuffer stress test (2 minutes max)
buffer size (bytes): 512
array size (bytes): 256
reader started on cpu 0
writer started on cpu: 0
49536 != 49408 at offset 0
failure in chunk 330502
=== Portaudio ringbuffer test ===
starting ringbuffer stress test (2 minutes max)
buffer size (bytes): 512
array size (bytes): 256
reader started on cpu 0
writer started on cpu: 0
Success
=== Portaudio ringbuffer test (without memory barriers) ===
starting ringbuffer stress test (2 minutes max)
buffer size (bytes): 512
array size (bytes): 256
reader started on cpu 0
writer started on cpu: 0
Success
--
jörn nettingsmeier
home://germany/45128 essen/lortzingstr. 11/
http://spunk.dnsalias.org
phone://+49/201/491621
Kurt is up in Heaven now.