Hi

> [[a slick little patch to just use setpriority]]
>
> And that works?!?

Do you mean my test result is not enough?

> Frankly, I should have tried this first, but I assumed it had been
> tried already and my groping around in NPTL source code seemed to
> indicate that it wouldn't. As long as this works, it is a much better
> solution than what I did.

The setpriority() is pure kernel feature. NPTL is unrelated.

Plus, Java JDK also is using setpriority(PRIO_PROCESS) for
supporting per-thread priority.

Strictly speaking, JavaVM don't have GVL, and it doesn't have
yield() flood issue either. but we have. This difference is important.
because GVL oftern makes confuse kernel thread scheduling.
Then, your patch works better in some case.

> How universal is this? You've got #ifdef linux in there, does that
> mean it won't work on any other posix system? Is this likely to work
> on windows? (I'm trying desperately to think of an excuse for keeping
> my patch around, can you tell?)

MacOS X, Solaris, Windows have each different changing way.
There isn't POSIX standard in this area unfortunatelly.

Plus we already windows one, see thread_win32.c#native_thread_apply_priority().

However, Some OS doesn't have per-thread priority feature at all. So,
I don't think your patch is useless. My intention was, I hoped to clarify
why you don't use setpriority() nor another os feature. your patch
didn't describe it.