Multi-thread javascript or WebMP


#1

I suggest directives like openmp.

  • restrict atomics and multithreading
  • read-only access from global space by default
  • access to global function if support webmp
  • special directives for open access to global variables (include atomics)
  • special directives for get thread ids
function parallel(A, B, C){
"use webmp";

"webmp atomic";
let counter = 0;

"webmp read-write array"
C;

"webmp parallel for";
for(let i=0;i<512;i++){
  "webmp threadId"
  let threadID;

  C[i] = A[i] + B[i];
}

}

#2

I believe this post is more appropriate for ES Discuss.