[whatwg] [WebWorkers] About the delegation example

Chris Jones cjones at mozilla.com
Sat Nov 7 00:42:34 PST 2009


Chris Jones wrote:
> If I were writing a computationally-bound webapp, I would want an 
> interface like
> 
> [main thread]
>   SharedWorker.parallelMap(workerfn [, ...]])
> 
> [worker thread]
>   function workerfn(myThreadIndex, numberOfworkerfns [, ...]) {
>      // partition problem dataset [...] based on |myThreadIndex| and 
> |numberOfworkerfns|
>      // compute
>   }
> 

On second thought, I think that worker semantics dictate that the 
dataset partitioning decision should be made by [main thread] before the 
workers are spawned.   But I don't think this significantly changes the 
API (move "// partition ..." into [main thread]).

Cheers,
Chris




More information about the whatwg mailing list