Necko: support sending OnDataAvailable() to other threads: Difference between revisions

Line 1: Line 1:
At the April 2009 Platform work week we had a meeting on making necko support requests from threads other than the main thread.  Here's some design notes on what we came up with.
At the April 2009 Platform work week we had a meeting on making necko support requests from threads other than the main thread.  Here's some design notes on what we came up with.


== Do we actually want to implement this, or wait for multi-process necko? ==
== Goals ==


The basic goal here is to allow the off-main-thread HTML 5 parser to get data from the network without having to proxy the data from the main thread.  The benefits are greater parallelism and reduced interference between the main thread and the parser thread (resulting in better UI responsiveness).
Goal: allow the off-main-thread HTML 5 parser to get data from the network without having to proxy the data from the main thread.   


Now that we are moving towards using multiple processes (see [[Content_Processes]]), there is some question of how useful the solution documented here is.  In the long run, we are going to be putting the HTML parser in separate processes rather than threads;  so this solution is at best a temporary one.  But since the API here should be faster to implement than the multi-process one, it might be a useful stopgap implementation for a release or two, until multi-process is ready for prime time.
Benefits: greater parallelism and reduced interference between the main thread and the parser thread (resulting in better UI responsiveness).  


The key question, then, is:  just how much performance/responsiveness benefit do we anticipate getting from eliminating proxied network receives, and having the HTML 5 off-thread parser get reads directly?  If this is not a significant win, I'd prefer to focus my attention on developing multiprocess networking.
Note that this is only useful for single-process Gecko (non-electrolysis)at least until IPDL supports sending/receiving on non-main threads, we will always need to use the main thread when multiple processes are used.
 
Thoughts on this matter would be appreciated.


== API target:  sending OnDataAvailable() to other threads ==
== API target:  sending OnDataAvailable() to other threads ==
Confirmed users
431

edits