Threading
Posted Jun 30, 2007 11:44 UTC (Sat) by
oak (guest, #2786)
In reply to:
Threading by mikov
Parent article:
Test driving Firefox 3
> My absolutely biggest gripe is that it is impossible to kill a single
Firefox window.
I.e. all windows belong to same process. I think the reason why this is
done is because browser startup is slow and due to amount of code, engine
state/initialization etc, it would also take quite a bit of additional
memory at startup. Also, with each window being in a separate process,
you would notice the heap fragmentation caused by the dynamic (JS, Flash
etc) HTML page contents much sooner (each separate window taking after a
day 1/2GB of RAM instead of single Browser process using that much).
It would be nice if Firefox binary would have an option that when you
start it from the command line it would start a new process instead of
asking an already existing Firefox instance to open a new window though...
> The second is that everything, including all separate windows, is
running in the same thread.
One should use separate threads only for separate functionality.
Otherwise the needed locking will kill your performance. Actually I think
it could be better if Firefox would get rid of threading completely, I
think most of the work is done in the main thread anyway, but use of
threads (at all) means that all mallocs within C-library need to be done
with locking. :-)
(Linking against thread library automatically replaces some functions from
C-library with their thread-safe functions. This can in some rare cases
lead to funny problems with dlopen()ed libs if one does linking wrong.)
(
Log in to post comments)