summaryrefslogtreecommitdiffstats
path: root/lf_ring_buffer_test.c
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2010-01-06 23:45:20 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2010-01-06 23:45:20 +0100
commit82a5bc70e5f85d7d40e04e6a7dc567b086025421 (patch)
tree6f6eb3ec2a9bf27e180dc264abe4802bc2d0b1c0 /lf_ring_buffer_test.c
parentce1dcb6ed32396910e3400e3a816b76d22d5a0de (diff)
downloadlock_free-82a5bc70e5f85d7d40e04e6a7dc567b086025421.zip
lock_free-82a5bc70e5f85d7d40e04e6a7dc567b086025421.tar.gz
ring buffer read : set read_from=-1 if read_from==write_to
Diffstat (limited to 'lf_ring_buffer_test.c')
-rw-r--r--lf_ring_buffer_test.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lf_ring_buffer_test.c b/lf_ring_buffer_test.c
index 348d202..e9e199a 100644
--- a/lf_ring_buffer_test.c
+++ b/lf_ring_buffer_test.c
@@ -6,8 +6,7 @@
#include "lf_ring_buffer.h"
-//#define BUFFER_LEN 5000000
-#define BUFFER_LEN 500
+#define BUFFER_LEN 5000000
static rb_data_t data[BUFFER_LEN][RB_DATA_LEN];
@@ -25,12 +24,14 @@ static void report( int n, uint64_t dt ) {
fprintf(stdout,"%d operations in %d [ms] => %d [us] => %d [ns]\t >>> %d [ns/op]\n", n, (int)(dt/1000000), (int)(dt/1000), (int)dt, (int)(dt/n) );
}
+/*
static void feed_data( int n){
int i;
for(i=0; i<n; i++){
sprintf(data[i],"hello world %04d\n",i);
}
}
+*/
static uint64_t sequential_writes( lf_ring_buffer_t *ring, int n, int flags ) {
int i;