A partial archive of discourse.wicg.io as of Saturday February 24, 2024.

Multi-thread javascript or WebMP

acterhd
2016-07-19

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];
}

}
JonathanSampson
2016-08-02

I believe this post is more appropriate for ES Discuss.