search for: count_threshold_cv

Displaying 2 results from an estimated 2 matches for "count_threshold_cv".

2009 Mar 18
3
[LLVMdev] Status of LLVM's atomic intrinsics
...rned 1 exit status The source is: #include <pthread.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #define NUM_THREADS 9 #define TCOUNT (1 << 23) #define COUNT_LIMIT (1 << 25) volatile int count = 0; pthread_mutex_t count_mutex; pthread_cond_t count_threshold_cv; void *inc_count(void *t) { int j,i; double result=0.0; long my_id = (long)t; for (i=0; i<TCOUNT; i++) { //void *data = malloc(1); int count2 = __sync_add_and_fetch(&count, 1); /* Check the value of count and signal waiting thread when condition is reached....
2009 Mar 18
0
[LLVMdev] Status of LLVM's atomic intrinsics
...d.h> > #include <unistd.h> > #include <stdio.h> > #include <stdlib.h> > > #define NUM_THREADS 9 > #define TCOUNT (1 << 23) > #define COUNT_LIMIT (1 << 25) > > volatile int count = 0; > pthread_mutex_t count_mutex; > pthread_cond_t count_threshold_cv; > > void *inc_count(void *t) > { > int j,i; > double result=0.0; > long my_id = (long)t; > > for (i=0; i<TCOUNT; i++) { > //void *data = malloc(1); > int count2 = __sync_add_and_fetch(&count, 1); > > /* > Check the value of...