Subject: change thread priorities
To: None <tech-kern@NetBSD.org>
From: Paul Winder <Paul.Winder@tadpole.com>
List: tech-kern
Date: 05/18/2006 11:20:35
I have a multithreaded application and I want to have some of the 
threads run at different priorities. I try:

	pthread_attr_init(&attr);
	pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
	param.sched_priority = 10;
	pthread_attr_setschedparam(&attr, &param);

The pthread_attr_setschedparam() call always returns EINVAL unless I set 
sched_priority to 0!

I also tried adding a call to:
	pthread_attr_setschedpolicy(&attr, SCHED_RR);

before pthread_attr_setschedparam(), but thats gets ENOTSUP.

I'm running current.

Does NetBSD support this?

Thanks
Paul

PS I also tried pthread_setschedparam() directly from the thread and 
that failed too.