Re: sched_setscheduler and pids/threads

From: Robert Love
Date: Wed Mar 09 2005 - 23:41:41 EST

On Thu, 2005-03-10 at 15:12 +1100, Dave Airlie wrote:

> In 2.6 all my threads appear as a single PID,if I use chrt -p <pid>
> will it set the scheduling priority for my main thread or for all
> threads in the application?

For just the main thread (or the thread of whatever PID you give). You
need to set the PID of each thread individually. The "everything
appears as a single PID" is just an elaborate parlor trick. Wool pulled
over your eyes.

> Can I used the thread IDs from /proc/<pid>/task/ to chrt the other
> threads in my app to different priorities?

You can use the PID's in /proc/<pid>/task/, yes.

Or you can just set the PID of the main thread before it starts other
threads, or use chrt to launch the program, or use chrt to set the PID
of a shell script that starts the application: Scheduler properties are


Robert Love

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at