View topic - what' wrong with the code?

what' wrong with the code?

anything that doesn't fit to other groups.

what' wrong with the code?

Postby xuyong » Mon Jul 14, 2003 12:45 am

I have 2 threads,I want to thread2 running as the thread2 is idle,so I think
I should reduce the priority level of thread2 compared with thread1,below is my code to achive it,but after doing that the priority level of thread1 and thread2 is still same.
pthread_attr_t attr;
int policy=SCHED_FIFO;
struct sched_param param;
pthread_attr_init( &attr );
param.sched_priority --;
pthread_attr_setschedparam(&attr, ¶m);
pthread_create (NULL, &attr, thread2, NULL);
Senior Member
Posts: 431
Joined: Sun Mar 02, 2003 7:52 am

Postby cdm » Mon Jul 14, 2003 4:29 am

You need to also change the inherit vs. explicit sched value...

Take a look at that call.
QNX Master
Posts: 789
Joined: Fri Jul 05, 2002 9:38 am

Return to General Programming

Who is online

Users browsing this forum: Google Adsense [Bot] and 1 guest