Priority scheduling in 6.x
Daniel Eischen
deischen at freebsd.org
Wed Jan 14 19:43:18 PST 2009
On Wed, 14 Jan 2009, Pramod Srinivasan wrote:
> Hi,
>
> I have 3 threads low, medium and high , and the scheduling policy is set to
> SCHED_FIFO. The priority of the threads are at 28,29,30 respectively. Looks
> like on FreeBSD 6.x, the priority of the threads are not honored while
> scheduling the threads, but the same test on FreeBSD 7.x seems to work fine.
> Are there known issues with the priority scheduling in FreeBSD 6.x or am I
> doing something wrong? (I am using libthr)
Are you using libpthread or libthr on 6.3?
If you are using libthr, then you need to be running with
superuser privileges for SCHED_FIFO to work. I'm not sure
if this works correctly at all in 6.3.
If you are using libpthread, then it will work if the
threads are PTHREAD_SCOPE_PROCESS, but will not work
if they are PTHREAD_SCOPE_SYSTEM. You do not need
superuser privileges for SCHED_FIFO with libpthread
and process scope threads. I don't believe the kernel
has ever worked properly for libpthread (kse) SCHED_FIFO
system scope threads.
--
DE
More information about the freebsd-threads
mailing list