Revision 370563 of ParallelArray

  • Revision slug: JavaScript/Reference/Global_Objects/ParallelArray
  • Revision title: ParallelArray
  • Revision id: 370563
  • Created:
  • Creator: evilpie
  • Is current revision? No
  • Comment

Revision Content

{{ Non-standard_header() }}

Summary

The goal of ParallelArray is to enable data-parallelism in web applications.

Syntax

new ParallelArray()
new ParallelArray([element0, element1, ...])
new ParallelArray(arrayLength, elementalFunction)

ParallelArray instances

Properties

length
Reflects the number of elements in the ParallelArray.

Methods

map
Apply map callback to array elements.
reduce
 
scan
scatter
Scatter array elements.
filter
flatten
partition
get
Get ParallelArray element.

Examples

Example: Using map in parallel

var p = new ParallelArray([0, 1, 2, 3, 4]);
var m = p.map(function (v) {
  return v + 1;
});

See also

Revision Source

<p>{{ Non-standard_header() }}</p>
<h2 id="Summary">Summary</h2>
<p>The goal of ParallelArray is to enable data-parallelism in web applications.</p>
<h2 id="Syntax">Syntax</h2>
<pre class="syntaxbox">
new ParallelArray()
new ParallelArray([element0, element1, ...])
new ParallelArray(arrayLength, elementalFunction)</pre>
<h2 id="ParallelArray_instances"><code>ParallelArray</code> instances</h2>
<h3 id="Properties">Properties</h3>
<dl>
  <dt>
    length</dt>
  <dd>
    Reflects the number of elements in the <code>ParallelArray</code>.</dd>
</dl>
<h3 id="Methods">Methods</h3>
<dl>
  <dt>
    map</dt>
  <dd>
    Apply map callback to array elements.</dd>
  <dt>
    reduce</dt>
  <dd>
    &nbsp;</dd>
  <dt>
    scan</dt>
  <dt>
    scatter</dt>
  <dd>
    Scatter array elements.</dd>
  <dt>
    filter</dt>
  <dt>
    flatten</dt>
  <dt>
    partition</dt>
  <dt>
    get</dt>
  <dd>
    Get ParallelArray element.</dd>
</dl>
<h2 id="Examples">Examples</h2>
<h3 id="Example.3A_Using_map_in_parallel">Example: Using map in parallel</h3>
<pre class="brush: js">
var p = new ParallelArray([0, 1, 2, 3, 4]);
var m = p.map(function (v) {
  return v + 1;
});</pre>
<h2 id="See_also">See also</h2>
<ul>
  <li><a href="http://wiki.ecmascript.org/doku.php?id=strawman:data_parallelism" title="http://wiki.ecmascript.org/doku.php?id=strawman:data_parallelism">Ecmascript ParallelArray strawman</a></li>
</ul>
Revert to this revision