Displaying 2 results from an estimated 2 matches for "pthread_attr_setinheritsched".
2018 Jan 24
0
libasan bug: pthread_create never returns
...perror("sched_setaffinity");
exit(EXIT_FAILURE);
}
printf("Hey from main\n");
schedule.sched_priority = 20;
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setschedpolicy(&attr, SCHED_RR);
pthread_attr_setschedparam(&attr, &schedule);
pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
pthread_t th;
int rc;
if ((rc = pthread_create(&th, &attr, dummy_worker, NULL)) != 0) {
errno = rc;
perror("pthread_create");
exit(EXIT_FAILURE);
}
pthread_join(th, NULL);
pthread_attr_destroy(&attr);
return 0;
}
2017 Feb 06
2
Real time threads don't work in libvirt containers under CentOS 7.3
...printf("Thread complete\n");
return 0;
}
int main(int argc, char *argv[])
{
int rc;
printf("Starting main\n");
struct sched_param tsparam;
pthread_attr_t tattr;
memset(&tsparam, 0, sizeof(tsparam));
pthread_attr_init(&tattr);
pthread_attr_setinheritsched(&tattr, PTHREAD_EXPLICIT_SCHED);
pthread_attr_setschedpolicy(&tattr, SCHED_FIFO);
tsparam.sched_priority = sched_get_priority_max(SCHED_FIFO) - 7;
pthread_attr_setschedparam(&tattr, &tsparam);
if ((rc = pthread_create(&test_thread, &tattr, test, NULL)) !=...