This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: EINVAL when SCHED_OTHER thread tries to hold PTHREAD_PRIO_PROTECT mutex
- From: Carlos O'Donell <carlos at codesourcery dot com>
- To: Sripathi Kodi <sripathik at in dot ibm dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 27 Mar 2008 10:50:13 -0400
- Subject: Re: EINVAL when SCHED_OTHER thread tries to hold PTHREAD_PRIO_PROTECT mutex
- References: <200803201646.24836.sripathik@in.ibm.com>
Sripathi Kodi wrote:
I have a program where a SCHED_OTHER thread tries to hold a
pthread_mutex_t initialized with the PTHREAD_PRIO_PROTECT protocol.
This fails with an EINVAL. Using strace/ltrace, I found that the
sched_setscheduler, internally called by pthread_mutex_lock returns
EINVAL, because it tries to set the priority of the thread to a value
not permissible for SCHED_OTHER.
This is probably because the kernel doesn't allow SCHED_OTHER processes
to have any priority other than 0? Have you tried using SCHED_RR?
Cheers,
Carlos.
--
Carlos O'Donell
CodeSourcery
carlos@codesourcery.com
(650) 331-3385 x716