[Sugar-devel] [PATCH] Set the DISPLAY env var once Xephyr has been launched
Tomeu Vizoso
tomeu at tomeuvizoso.net
Wed May 26 05:05:11 EDT 2010
On Wed, May 19, 2010 at 23:15, James Cameron <quozl at laptop.org> wrote:
> I'm unsure of the reasons for the change.
>
> Instead of setting DISPLAY and SUGAR_EMULATOR_PID environment variables
> repeatedly for each attempt to run Xephyr, set the variables once.
But that's what the patch does, moves setting those variables from the
loop in _start_xephyr to somewhere close to the end of main().
Bernie has sent another patch that does this same thing.
> This would be effective in reducing CPU cost if there is contention in
> display numbers.
>
> Further efficiency during contention could also be gained by factoring
> much of _run_xephyr; there are many other steps there that might be done
> only once.
>
> Further readability might be gained by considering _setup_env. It sets
> environment variables that will be available to the Xephyr process,
> though I can't see a need for them there. Perhaps all environment
> variables could be moved there, and the display and pipe passed to it.
That sounds good to me.
Regards,
Tomeu
> Not tested.
>
> Reviewed-by: James Cameron <quozl at laptop.org>
>
> --
> James Cameron
> http://quozl.linux.org.au/
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
More information about the Sugar-devel
mailing list