system priorities

Daniel Eischen eischen at vigrid.com
Fri Apr 30 14:04:04 PDT 2004


On Fri, 30 Apr 2004, Petri Helenius wrote:

>=20
> Am I correct in the observation that threads inherit their scheduling=20
> priority (nice and rtprio)
> from the first "main" thread in the process instead of the parent thread?

As it stands now, newly created KSEGs inherit from the creating
KSEG.  The nice and rtprio priorites are stored in the KSEG.

> I=B4m creating a few system scope threads from a rtprio main process and=
=20
> then dropping rtprio in the created threads and then creating more=20
> threads from them which seem to get rtprio from somewhere.

It looks like rtprio will set the priority of the first
KSEG in the proc's list of KSEGs.  This isn't necessarily
the first KSEG created (main).  In fact, newly created
KSEGs get inserted onto the head of the list, so rtprio()
may act on different KSEGs depending on if it is called
before or after any KSEG creations.

[ System scope threads =3D=3D new KSEG creation ]

> Is there a specification reference on this and if not, would it make=20
> more sense to inherit them from the parent thread?

I think they do inherit from the parent KSEG, but rtprio()
may not be setting the priority for the current KSEG.

I would really like a Solaris-like priocntl() so that you
can specify which KSEG (or whatever thing that will hold
the priority in the future) to act on.

--=20
Dan Eischen



More information about the freebsd-threads mailing list