maybe it's because you're locking/unlocking the mutex in tight sequence in the main line loop?
try this pattern instead:
pthread_mutex_lock(&updateThreadMutex); while (updateThreadIsRunning) { pthread_cond_wait(&updateThreadCv, &updateThreadMutex); ModSynth::get_instance()->update_tasks(0); prvStartts.tv_usec = startts.tv_usec; gettimeofday(&startts, NULL); fprintf(stderr, "Time from last block: %i Time from prev block end time [us]: %i\n", startts.tv_usec- prvStartts.tv_usec, startts.tv_usec - stopts.tv_usec); . . . gettimeofday(&stopts, NULL); } pthread_mutex_unlock(&updateThreadMutex);
seeya
Copyright (C) 2006-2024 rncbc aka Rui Nuno Capela. All rights reserved.
Powered by Drupal
Recent comments
4 min 24 sec ago
30 min 33 sec ago
9 hours 26 min ago
12 hours 35 min ago
13 hours 1 min ago
16 hours 2 min ago
16 hours 32 min ago
23 hours 44 min ago
1 day 7 hours ago
1 day 9 hours ago