masters-thesis/listings/time_thread.c
Dennis af25b4b828 Initial commit of master's thesis
This is the version I submitted to RWTH Aachen University at November 9,
2018.
2018-11-12 12:56:59 +01:00

27 lines
593 B
C

// Global variable
struct timespec tp;
void * t_function(void * ctx)
{
while (1) {
clock_gettime(CLOCK_MONOTONIC, &tp);
}
return NULL;
}
pthread_t t_thread;
pthread_create(&t_thread, NULL, t_function, NULL);
// `int messages' represents the number of messages to be sent
for (int i = 0; i < messages; i++) {
/**
* Prepare WR with sge that points to tp.tv_nsec. It will
* continue to change since the thread continues to run in the
* background.
*/
// No need to invoke clock_gettime() here
ibv_post_send(); // Post prepared WR
}