LWN.net Logo

Threading

Threading

Posted Jun 30, 2007 22:50 UTC (Sat) by mikov (subscriber, #33179)
In reply to: Threading by oak
Parent article: Test driving Firefox 3

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. :-)

I have to disagree. Speaking in general, there are no hard and fast rules in threading and you can't say that locking kills performance without a more specific context. What does "separate functionality" mean anyway ?

It is true that for some (many?) kinds of servers a single thread can achieve better throughput, but for GUI-s this is plain wrong. In a GUI you should be concerned with latency before all, and not with absolute performance. The UI should react immediately to every user action, even if it takes a bit longer to actually complete it.

I do agree that having an option to open new windows in a separate process would go a long way towards improving the situation.


(Log in to post comments)

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds