13#define ERROR_RETURN(retval) { fprintf(stderr, "Error %d %s:line %d: \n", retval,__FILE__,__LINE__); exit(retval); }
16#define SLEEP_VALUE 20000
24 int *pointer, * pointer2;
52 printf(
"Thread specific data is %d \n", *pointer2);
73int main(
int argc,
char **argv)
77 int result_m, result_s,
rc,
i;
86 result_m = 2 * result_m -
i;
96 printf(
"Library initialization error! \n");
107 rc = pthread_create(&master, NULL,
Master, NULL);
112 rc = pthread_create(&slave1, NULL,
Slave, NULL);
117 pthread_join(master, NULL);
118 printf(
"Master: Expected: %d Recieved: %d\n", result_m,
count);
119 if (result_m !=
count)
123 pthread_join(slave1, NULL);
124 printf(
"Slave: Expected: %d Recieved: %d\n", result_s,
count);
126 if (result_s !=
count)
Retrieve a pointer to a thread specific data structure.
initialize the PAPI library.
Lock one of two mutex variables defined in papi.h.
Notify PAPI that a thread has 'appeared'.
Set the current debug level for error output from PAPI.
Store a pointer to a thread specific data structure.
Initialize thread support in the PAPI library.
Unlock one of the mutex variables defined in papi.h.
#define ERROR_RETURN(retval)
Return codes and api definitions.
unsigned long int pthread_t