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 days 7 hours ago
2 days 9 hours ago
2 days 21 hours ago
3 days 6 hours ago
3 days 9 hours ago
2 weeks 4 hours ago
2 weeks 4 hours ago
2 weeks 3 days ago
3 weeks 2 days ago
3 weeks 2 days ago