Replies: 1 comment
-
My understanding is that SharedArrayBuffer is usable on Chrome, Firefox, and Safari. In order to use it, certain cross-origin headers need to be specified by the webserver, which would create a minor additional deployment challenge, and I believe these headers may break the current oauth2-based authentication support in Neuroglancer, but I expect a workaround would be possible. However, the main benefit of SharedArrayBuffer is when using webassembly. Since all data for a webassembly program is stored in the linear memory, it permits regular multi-threaded programs to run somewhat normally, using standard mutex/condition var/atomics to synchronize state rather than sending messages. From JavaScript alone there is less use for SharedArrayBuffer --- it doesn't help us share regular javascript objects, everything shared has to be serialized as a byte array. It would allow chunks to be accessible to both the chunk worker and UI thread simultaneously, but that is useful only in certain rare cases --- e.g. for your PR that computes a list of the visible annotations, that list could be computed on a background thread if using SharedArrayBuffer. |
Beta Was this translation helpful? Give feedback.
-
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer
Some features are still unsupported in Firefox. In the discussion last week, it was mentioned we don't have SharedArrayBuffers but it sounded like it also wasn't considered necessary. I was wondering, could this simplify some of the codebase (maybe once Firefox completes their implementation)?
Beta Was this translation helpful? Give feedback.
All reactions