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
2 hours 33 min ago
4 hours 4 min ago
4 hours 8 min ago
14 hours 31 min ago
1 day 2 hours ago
1 day 10 hours ago
1 day 12 hours ago
2 days 2 hours ago
2 days 3 hours ago
2 days 3 hours ago