pthread attr update

pull/5/head
Guenael 2016-06-26 23:34:45 -04:00
rodzic 81edbc091c
commit 382a238a21
1 zmienionych plików z 6 dodań i 4 usunięć

Wyświetl plik

@ -638,12 +638,14 @@ int main(int argc, char** argv) {
printf("Wait for time sync (start in %d sec)\n\n", uwait/1000000);
/* Prepare a low priority param for the decoder thread */
struct sched_param p;
struct sched_param param;
pthread_attr_init(&dec.tattr);
pthread_attr_setschedpolicy(&dec.tattr, SCHED_RR);
pthread_attr_getschedparam(&dec.tattr, &p);
p.sched_priority = 40;
pthread_attr_setschedparam(&dec.tattr, &p);
pthread_attr_getschedparam(&dec.tattr, &param);
param.sched_priority = 90; // = sched_get_priority_min();
pthread_attr_setschedparam(&dec.tattr, &param);
//int res=0;
//printf("get: %d\n", res);
/* Create a thread and stuff for separate decoding
Info : https://computing.llnl.gov/tutorials/pthreads/