JavaScript/HandlingThreads: Difference between revisions
No edit summary |
|||
Line 3: | Line 3: | ||
Here are the choices we have. We can pick more than one. | Here are the choices we have. We can pick more than one. | ||
= Nothing = | |||
=== Description === | |||
=== Advantages === | |||
=== Disadvantages === | |||
= MT Proxies = | = MT Proxies = | ||
=== Description === | === Description === | ||
=== Advantages === | === Advantages === | ||
=== Disadvantages === | === Disadvantages === | ||
= | |||
Not possible on non-global scope objects, which must be native (Call, Block, DeclEnv) | |||
= Environment cloning = | |||
=== Description === | === Description === | ||
=== Advantages === | === Advantages === | ||
=== Disadvantages === | === Disadvantages === | ||
= | = Env. cloning + global-MT-proxy = | ||
=== Description === | === Description === | ||
=== Advantages === | === Advantages === | ||
=== Disadvantages === | === Disadvantages === | ||
= | = ChromeWorkers w/ usable Constructor = | ||
=== Description === | === Description === | ||
=== Advantages === | === Advantages === | ||
Line 32: | Line 39: | ||
Implementation cost. | Implementation cost. | ||
A new, different threading model, in addition to anything like Workers and the old nsIThreadManager models. | |||
= Example Users = | = Example Users = |
Revision as of 23:48, 16 November 2010
In Firefox 4, JS extensions using nsIThread.dispatch won't work the same way they have in the past. The purpose of this page is to document the design choices we have, so we can get to a decision, late though it may be.
Here are the choices we have. We can pick more than one.
Nothing
Description
Advantages
Disadvantages
MT Proxies
Description
Advantages
Disadvantages
Not possible on non-global scope objects, which must be native (Call, Block, DeclEnv)
Environment cloning
Description
Advantages
Disadvantages
Env. cloning + global-MT-proxy
Description
Advantages
Disadvantages
ChromeWorkers w/ usable Constructor
Description
Advantages
Disadvantages
Structured cloning with WrappedNative sharing
Description
In addition to chrome workers with a working constructor, we could add support for structured cloning of wrapped natives.
Advantages
This would allow a programming style that is more similar to what worked before with Thread.dispatch. Thread-safe C++ objects could be sent across to a different thread using postMessage and then operated on there.
Disadvantages
Implementation cost.
A new, different threading model, in addition to anything like Workers and the old nsIThreadManager models.