← Back to team overview

elementary-dev-community team mailing list archive

Re: 5 ideas that every desktop OS should borrow


2012/4/18 Victor Eduardo <victoreduardm@xxxxxxxxx>

> Hey Sergey, all these are awesome ideas!
> I can rewrite your script on my free time (i.e. after I'm done with
> relevant Noise stuff). Coding it in directly C might be safer in my
> opinion. Did you push it to some branch?
> Regards,
> Victor

Hey Victor,

I'm glad to hear that!

Tom Beckmann already wrote a proof-of-concept in Vala, see
It's not production-ready for two reasons: first, it uses Process.
spawn_command_line_sync() which is a wrapper to system() function which is
dreadfully insecure. It should use setpriority() function instead (see "man
setpriority" or view it online at
Second, it doesn't prevent process children from inheriting high
priority, and doesn't drop priorities of child processes on unfocusing the

I've recently discovered that ulatencyd provides a D-bus interface to
manage process priorities, it probably would be better just to signal it
instead of doing everything ourselves. It will also solve the priority
inheritance puzzle.

Also, I still haven't figured out how ulatencyd's Xorg "data provider"
works. All I know is that it's polling-based (which is not necessarily a
bad idea, because quick focus switching with e.g. Alt+Tab can switch focus
very quickly and make ulatencyd use CPU a lot) and it doesn't seem to work
unless ulatencyd is started from X manually (probably doesn't detect
session changes). Maybe it's better to fix ulatencyd's data provider than
to write something custom. I suppose I'll be posting a message to ulatencyd
mailing list soon, I'll ask why it's so and what approach should we take.

Sergey "Shnatsel" Davidoff