3 ms·
Just a note: shared memory is coming and I think Firefox Nightly has an experimental version that you can enable in about:config.
by moron4hire 11y ago
Just a note: shared memory is coming and I think Firefox Nightly has an experimental version that you can enable in about:config.
- jvilk 11y agoIt's true that SharedArrayBuffer is coming, but there's no way to share objects from what I understand. Since Doppio maps JVM objects to JS objects, it cannot take advantage of shared array buffers to emulate shared memory threads.
- moron4hire 11y agoWell, at some point, all objects are just a blob of bytes.
- jvilk 11y agoWell, if we represented objects with a blob of bytes, we would have to implement our own garbage collector and manage our own heap, as object references would just be a pointer that points into an array somewhere. For interop with JavaScript, there's a usability difference between a JavaScript object and a blob of bytes, although that could be overcome with an object "mirror" that proxies operations appropriately. Our approach was to leverage the existing GC and language features that browsers already have.