dts_t *deltas = NULL;
int nb_measurements = 0;
-pthread_mutex_t *mutex = NULL;
char *message = "Clock accurency";
void (*usage_ext) (FILE *) = NULL;
#define MAXDUR 1000
#define MINDUR 100
-int init (dts_t *buffer, int nb, pthread_mutex_t *synchro)
+int init (dts_t *buffer, int nb, __attribute__((unused)) pthread_barrier_t *synchro)
{
/* set global variables */
deltas = buffer;
nb_measurements = nb;
- mutex = synchro;
return 0;
}
void *ping (__attribute__((unused)) void *arg)
{
- pthread_mutex_unlock (mutex);
-
for (int i = 0; i < nb_measurements; i++) {
int duration = MINDUR * ((MAXDUR / MINDUR) * rand () / RAND_MAX);
void *pong (__attribute__((unused)) void *arg)
{
- pthread_mutex_unlock (mutex);
pthread_exit (NULL);
}
dts_t *deltas = NULL;
int nb_measurements = 0;
-pthread_mutex_t *mutex = NULL;
char *message = "Cycle latency";
void (*usage_ext) (FILE *) = NULL;
#define MAXDUR 1000
#define MINDUR 100
-int init (dts_t *buffer, int nb, pthread_mutex_t *synchro)
+int init (dts_t *buffer, int nb, __attribute__((unused)) pthread_barrier_t *synchro)
{
/* set global variables */
deltas = buffer;
nb_measurements = nb;
- mutex = synchro;
return 0;
}
void *ping (__attribute__((unused)) void *arg)
{
- pthread_mutex_unlock (mutex);
-
for (int i = 0; i < nb_measurements; i++) {
int duration = MINDUR * ((MAXDUR / MINDUR) * rand () / RAND_MAX);
void *pong (__attribute__((unused)) void *arg)
{
- pthread_mutex_unlock (mutex);
pthread_exit (NULL);
}
dts_t *deltas = NULL;
int nb_measurements = 0;
-pthread_mutex_t *mutex = NULL;
char *message = "Thread (create and join) latency";
void (*usage_ext) (FILE *) = NULL;
int rc = 0;
-int init (dts_t *buffer, int nb, pthread_mutex_t *synchro)
+int init (dts_t *buffer, int nb, __attribute__((unused)) pthread_barrier_t *synchro)
{
/* set global variables */
deltas = buffer;
nb_measurements = nb;
- mutex = synchro;
return 0;
}
void *ping (__attribute__((unused)) void *arg)
{
- pthread_mutex_unlock (mutex);
-
for (int i = 0; i < nb_measurements; i++) {
ts_t ts1;
void *pong (__attribute__((unused)) void *arg)
{
- pthread_mutex_unlock (mutex);
pthread_exit (NULL);
}
dts_t *deltas = NULL;
int nb_measurements = 0;
-pthread_mutex_t *mutex = NULL;
char *message = "Thread (create) latency";
void (*usage_ext) (FILE *) = NULL;
ts_t ts1, ts2;
int rc = 0;
-int init (dts_t *buffer, int nb, pthread_mutex_t *synchro)
+int init (dts_t *buffer, int nb, __attribute__((unused)) pthread_barrier_t *synchro)
{
/* set global variables */
deltas = buffer;
nb_measurements = nb;
- mutex = synchro;
return 0;
}
void *ping (__attribute__((unused)) void *arg)
{
- pthread_mutex_unlock (mutex);
-
for (int i = 0; i < nb_measurements; i++) {
sys_timestamp (&ts1);
void *pong (__attribute__((unused)) void *arg)
{
- pthread_mutex_unlock (mutex);
pthread_exit (NULL);
}