0

I'm abbreviating sharedArrayBuffer with SAB

How can I store a large tree in a SAB that it could be read by multi-threads in the browser?

difficulties

  1. there doesn't seem to be a pointer in JavaScript to put in a SAB and point to the next SAB;

  2. the tree needs to be modified dynamically, and it seems that this cannot be simply simulated using arrays;

some of my thoughts

Store multiple SAB arrays in one thread, mark each SAB with a symbol, and use postMessage when multiple threads need to point to the next SAB.

But I think the above approach is very unelegant and may have performance issues

Chen Zeyu
  • 11
  • 3

0 Answers0