From: "Phil Pellouchoud" <Phil@slacker.com>
To: <pthreads-win32@sourceware.org>
Subject: trouble with pthread_attr_setschedparam()
Date: Sat, 08 Mar 2008 17:56:00 -0000 [thread overview]
Message-ID: <40AB5A80E5E562409254E65CBACFE2BD01B90C47@BBMAIL.corp.bbi.com> (raw)
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
reply other threads:[~2008-03-08 17:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40AB5A80E5E562409254E65CBACFE2BD01B90C47@BBMAIL.corp.bbi.com \
--to=phil@slacker.com \
--cc=pthreads-win32@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).