Go to the source code of this file.
|
| void | lockloop (int iters, volatile long long *mycount) |
| |
| void * | Slave (void *arg) |
| |
| int | main (int argc, char **argv) |
| |
◆ APPR_TOTAL_ITER
| #define APPR_TOTAL_ITER 1000000 |
◆ MAX_THREADS
◆ lockloop()
| void lockloop |
( |
int |
iters, |
|
|
volatile long long * |
mycount |
|
) |
| |
◆ main()
| int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 53 of file ctests/locks_pthreads.c.
69 if (hwinfo == NULL ) {
70 test_fail( __FILE__, __LINE__,
"PAPI_get_hardware_info", 2 );
77 "PAPI_thread_init",
retval );
81 "PAPI_thread_init",
retval );
96 printf(
"Creating %d threads, %lld lock/unlock\n",
100 for (
i = 0;
i < nthr;
i++ ) {
101 rc = pthread_create( &slaves[
i], NULL,
Slave, NULL );
105 "pthread_create",
retval );
109 for (
i = 0;
i < nthr;
i++ ) {
110 pthread_join( slaves[
i], NULL );
114 printf(
"Expected: %lld Received: %lld\n",
120 test_fail( __FILE__, __LINE__,
"Thread Locks", 1 );
void test_pass(const char *filename)
unsigned long int pthread_t
void test_skip(const char *file, int line, const char *call, int retval)
int PAPI_thread_init(unsigned long int(*id_fn)(void))
int PAPI_library_init(int version)
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
volatile long long thread_iter
const PAPI_hw_info_t * PAPI_get_hardware_info(void)
◆ Slave()
| void* Slave |
( |
void * |
arg | ) |
|
Definition at line 36 of file ctests/locks_pthreads.c.
45 printf(
"%f lock/unlocks per us\n",
void lockloop(int iters, volatile long long *mycount)
long long PAPI_get_real_usec(void)
volatile long long thread_iter
◆ count
| volatile long long count = 0 |
◆ quiet
◆ thread_iter
| volatile long long thread_iter = 0 |
◆ tmpcount
| volatile long long tmpcount = 0 |