W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2009

[whatwg] [WebWorkers] About the delegation example

From: Chris Jones <cjones@mozilla.com>
Date: Sat, 07 Nov 2009 02:42:34 -0600
Message-ID: <4AF532FA.3010101@mozilla.com>
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
Received on Saturday, 7 November 2009 00:42:34 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:18 UTC