Message2607

Author aoiko
Recipients
Date 2007-04-30.12:49:01
Content
On Tuesday 17 April 2007 15:42, Simon 'corecode' Schubert wrote:
[...]
> Known issues (of libthread_xu/system):
> Mozilla stuff doesn't work.  they use sched_get_priority_min/max() and
> pthread_setsched_prio().  units disagree (former reporting -20/20, later
> expecting 0-32 or so).  this has to be streamlined somehow.
>
> Unfortunately I won't have time to do this in the next month because I am
> on tour, so I'd be grateful if somebody else could jump in.  It's not much
> work left!

The first attached patch (lwp_prio) adds a new syscall

int    lwp_rtprio (int, pid_t, lwpid_t, struct rtprio *);

that monkeys rtprio(2) and works on lwps. The other patch brings in code from 
freebsd (+ some small changes to /not/ silently accept any priority value for 
SCHED_OTHER) in libthread_xu, so that now my test program can only set 
priority values within sched_get_priority_{min,max} and smaller/larger values 
fail. The values are passed on to the kernel using lwp_rtprio() but the 
kernel side is not well tested.

Since, AFAICT lwpid can be zero lwp_rtprio() uses pid 0 for "current process" 
but lwpid -1 for "current thread", which IMO is ugly. Perhaps we should also 
reserve lwpid 0? Alternatively, I can change it to -1 for both. Then again, 
very few programs are ever going to use this. Opinions are welcome.

Don't know if this fixes thunderbird; can someone who has it linked against 
libpthread switch the symlink and test?

Aggelos
Files
File name Uploaded
lwp_rtprio.patch aoiko, 2007-04-30.12:49:01
xu-schedparams-checkother.patch aoiko, 2007-04-30.12:49:01
History
Date User Action Args
2007-04-30 12:49:04aoikolinkissue622 messages
2007-04-30 12:49:01aoikocreate