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

Reply via email to