Shared memory between isolates using IndexedDB

I am currently working with Isolates and want to know if using IndexedDB to exchange data between Isolates is a good way to communicate? In particular, I want one Isolate to be able to write to him, and then tell the other Isolates, which they can only read. These are data that are considered unchanged after they are written and are large enough. The main reason I want to do this is because I do not want to send a 6 MB card to 3 different Isolates, as it is a bit intense in the program.

+3
source share
2 answers

Website workers let you transfer massive buffers between workers without copying. However, as soon as you transfer the array buffer to another employee, the original employee loses access to its contents.

So, you can try to save your data structure in an array buffer to take advantage of this.

See the mdn and html5rocks article .

So, for Dart, save your data in ByteData , and then, when compiled via dartjs, this should not be copied, but transferred.

: Mozilla -. emscripten c javascript. , , , .

+2

IndexedDB, . , , . / . IndexedDB / .

0

All Articles