On Thu, 20 Dec 2001, John Baldwin wrote:

> On 20-Dec-01 Luigi Rizzo wrote:
> > On Thu, Dec 20, 2001 at 12:16:03PM -0800, John Baldwin wrote:
> >> However, kthreads should tsleep() with their current priority, not PPAUSE.
> >
> > "current" meaning pri_level or pri_native ? What if one tries to
> > tsleep() while holding a lock and so its pri_level is raised ?
>
> pri_level.  Calling tsleep() while holding a lock is a bug though. :)  Unless
> you are calling msleep() with a lock that will be released.
>
> > In the device polling code i did a tsleep on the "original" pri_level,
> > but maybe pri_native is good enough.
>
> pri_level is more correct.
I think pri_native is just an implementation detail which shouldn't
be used or visible to threads.  It used used by the priority propagation
mechanism to hold the original pri_level.  Threads should just use their
original priority (or a different one if they want to temporarily change
thier priority).  Even pri_level probably shouldn't be used or visible
to threads.

Bruce


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to