Displaying 2 results from an estimated 2 matches for "pthread_attr_setschedpolicy".
2018 Jan 24
0
libasan bug: pthread_create never returns
...t);
CPU_SET(1, &cpuset);
if (sched_setaffinity(getpid(), sizeof(cpuset), &cpuset) == -1) {
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");
ex...
2017 Feb 06
2
Real time threads don't work in libvirt containers under CentOS 7.3
...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)) != 0) {
printf("Unable to start rt thread\n");
}...