Re: [PATCH] [request for inclusion] Realtime LSM

Ingo Molnar
2005-01-18T08:04:21Z

* Jack O'Quin <joq@io.com> wrote:

> In the absence of any documentation, I'm guessing about storing the
> nice value in the priority field of the sched_param struct. But, I
> have not been able to figure out how to make that work.

the call you need is:

setpriority(PRIO_PROCESS, tid, -20);

where 'tid' is the TID (pid) of the thread in question. There's no way i
know of to utilize the pthread_t ID to do this, so you'll have to figure
the TID out via gettid() - which needs to happen in the child context -
how hard would it be to attach the TID field to some per-thread Jack
structure? [while the purpose is still a quick hack.]

Ingo