* trouble with pthread_attr_setschedparam()
@ 2008-03-08 17:56 Phil Pellouchoud
0 siblings, 0 replies; only message in thread
From: Phil Pellouchoud @ 2008-03-08 17:56 UTC (permalink / raw)
To: pthreads-win32
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-03-08 17:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-08 17:56 trouble with pthread_attr_setschedparam() Phil Pellouchoud
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).