Google Chrome

Hal Duston hald at kc.rr.com
Fri Sep 5 10:41:07 CDT 2008


On Fri, Sep 05, 2008 at 09:27:13AM -0500, Monty J. Harder wrote:
> 
> Yes, they exec to spawn these separate processes.  But those processes can't
> change the arguments under which they were invoked without themselves
> exec-ing all over again.  So when you click on a "Heh.", you'd have to
> change one process from
> monster 3952 26665 0 10:08 ? /usr/lib/firefox-4.0/firefox-bin -UILocale
> en-US instapundit.com
> to
> monster 3952 26665 0 10:08 ? /usr/lib/firefox-4.0/firefox-bin -UILocale
> en-US  johndoe.blogspot.com/2008/09/snarky-article-title-here.html
> 
> The only way I know to do that is to exec firefox-bin, invoking the new URL
> as an argument.   What I don't know is how much overhead that takes.  I
> suppose a stripped-down binary, that inherits a pre-built environment
> populated by another binary reading configs, etc., might not be doable.
> 
> But that's not the way that any existing browser I know of is written.
> You're talking about a complete re-factoring of how browsers work.  That's
> not to say that it's a bad idea, just that it's a non-trivial effort, which
> might make things much slower

A process can change the arguments at any time w/o doing an exec.  I have
actually read the code that is needed to do this under Linux.  It is less
than 15 lines.  All it does is rebuild the environment which is where the
exec'ed command line arguments are kept.  Once they are rebuilt ps,  top,
and everything else just pick them up from /proc/<pid>/cmdline.

Thanks,
--
Hal


More information about the Kclug mailing list