This is the mail archive of the
pthreads-win32@sourceware.org
mailing list for the pthreas-win32 project.
trouble with pthread_attr_setschedparam()
- From: "Phil Pellouchoud" <Phil at slacker dot com>
- To: <pthreads-win32 at sourceware dot org>
- Date: Sat, 8 Mar 2008 09:55:57 -0800
- Subject: trouble with pthread_attr_setschedparam()
Hi,
I am having trouble getting pthread_attr_setschedparam() to work. I can
call the function, and I don't get an error back, but when I go to get
the priority, I get back zero, no matter what I set it to.
---- code snippet ----
-- main code.
pthread_attr_init()
pthread_attr_setdetachstate(...PTHREAD_CREATE_JOINABLE)
pthread_attr_getschedparam(sp)
sp.sched_priority = 10;
pthread_attr_setschedparam(sp)
pthread_create(...)
pthread_attr_destroy()
-- thread function
static void* __cdecl ThreadFunc(void* pArg)
int priority(0);
pthread_attr_init()
pthread_attr_getschedparam(sp)
// right here, sp.sched_priority is always zero!!!
pthread_attr_destroy()
---- code snippet ----
Also, is there any way to set the priority for a child thread after it
has been created? Maybe a better way to ask that question is if there
is a way to set a priority for a child thread from a parent thread?
-phil