Re: [PATCH] make setpriority POSIX compliant; introduce PRIO_THREAD extension

Christoph Hellwig
2008-09-10T12:08:56Z

On Mon, Sep 01, 2008 at 04:12:35PM +0200, Denys Vlasenko wrote:
> Attached patch changes setpriority(PRIO_PROCESS) to set priority
> for all threads with selected pid. getpriority is changed accordingly,
> to return the (numerical) max of all threads' priority.
>
> In order to allow priority of individual threads to be manipulated,
> patch adds PRIO_THREAD which acts on single thread, always.

Bad idea, you silently change the existing interface, and programs that
used to work around the old Linux behvaiour silently break. Just keep
PRIO_PROCESS as it was and add a new PRIO_TGROUP that does the Posix
functionality for the whole thread group. Glibc can then implement
the library-PRIO_PROCESS as PRIO_TGROUP for newly linked applications
without breaking existing ones.