Questions tagged [sharedarraybuffer]

`SharedArrayBuffer` is a JavaScript object that provides for sharing memory across threads.

SharedArrayBuffer (MDN, spec) is a JavaScript object that provides for sharing memory across threads, such as web worker threads in browsers, or worker threads in Node.js.

72 questions
1
vote
1 answer

javascript sharedArrayBuffer and bitwise operations returning a 32bit instead of 16bit number

javascript, 2020: I've never worked with the sharedArrayBuffer, (or bits) and I have some questions. Basically I want to store a set of bools and a small counter (4-bit), on a single Int16Array element. but as I manipulate the slot of memory- it…
1
vote
2 answers

Javascript Workers - why is the worker message treated so lately and can I do something against it?

I have a Worker that shares a SharedArrayBuffer with the "main thread". To work correctly, I have to make sure that the worker has access to the SAB before the main thread accesses to it. (EDIT: The code creating the worker has to be in a seperate…
ixolius
  • 202
  • 1
  • 11
0
votes
1 answer

How to resolve the issue of FFmpeg.wasm not working about SharedArrayBuffer error properly when using Nginx as a server and use Vite no error?

I am using FFmpeg.wasm for some frontend transcoding work. I know that due to certain browser policies, I need to configure some response headers in the Vite server options: server: { headers: { 'Cross-Origin-Opener-Policy': 'same-origin',…
bully
  • 23
  • 2
0
votes
0 answers

How to use SharedArrayBuffer store a tree in the browser

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 there doesn't seem to be a pointer in JavaScript to put in a SAB and point to the next SAB; the…
0
votes
0 answers

How to implement multiple spotlighting using the Zoom Web SDK in component view - SharedArrayBuffer configuration

I have been trying to use the Zoom Web SDK to implement an embedded meeting in a NextJS web app. The default mode works fine, but enabling the SharedArrayBuffer is not working as it should. Using the below nextjs config for setting headers to…
dbau
  • 1
  • 2
0
votes
1 answer

How to Play a Godot 4 HTML Project Locally?

I have exported the web version of my Godot 4, it is in a folder on my local drive. Because of the SharedArrayBuffer dependency I can not just double-click in the index.html file. If I do so I see this error: Error The following features required…
fguillen
  • 36,125
  • 23
  • 149
  • 210
0
votes
0 answers

Cross-origin isolation in a Firefox extension

In Chrome, one can make an extension cross-origin isolated by adding the following to manifest.json: { ... "cross_origin_embedder_policy": { "value": "require-corp" }, "cross_origin_opener_policy": { "value":…
0
votes
0 answers

How to enable SharedArrayBuffer in CoreWebView2?

I am using CoreWebView2 to bring a webapp onto the windows desktop. The webapp uses a webassembly module that relies on SharedArrayBuffers. I can enable SharedArrayBuffer with the correct setting of Cross-Origin-Opener-Policy and…
0
votes
1 answer

How do I check if a value is a `SharedArrayBuffer` view, in Javascript?

The ArrayBuffer.isView() static method checks if it's one of the ArrayBuffer views, such as TypedArray objects or a DataView. How do you check if it's a view of a SharedArrayBuffer? It's been a quite long time since SharedArrayBuffer was introduced,…
0
votes
1 answer

"SharedArrayBuffer is not defined" error in cloud server but working in localhost

I have enable SharedArrayBuffer and was working in my localhost but once i pushed it to testing environment it is not working. I added these cors headers to enable SharedArrayBuffer Cross-Origin-Opener-Policy:…
0
votes
1 answer

Analytics with Cross-Origin-Opener-Policy?

I have one page on my site that uses SharedArrayBuffer, which means I need to use Cross-Origin-Opener-Policy - but this also means I can't use analytics to see if anyone actually uses that page or not. So I wondered if there's a workaround for…
0
votes
0 answers

NodeJS Worker Thread use SharedArrayBuffer final result incorrect value

I was just tinkering and messing around with worker thread in NodeJS and managed to do so in a fundamental way. But running the child process and expecting result to be "30,000" after running 3 workers but occasionally get incorrect value. //…
Howard F
  • 138
  • 12
0
votes
1 answer

How to post a message from a web worker to another web worker Javascript

I am trying to send a message from one worker to the other (and then respond back through a SharedArrayBuffer). But I can't find any information on posting a message to another worker from within a worker. How would I go about doing it? (I tried…
yosmo78
  • 489
  • 4
  • 13
0
votes
1 answer

Sharing array of nested objects between workers

I have an array of objects which contains more objects as values. I'm working with Web Workers and I need to use this exact array of objects (or another object) in worker file. Problem is I couldn't find any solution to forward this array or object…
hakan
  • 1
0
votes
0 answers

WebAssembly/SharedArrayBuffer support in recent browsers for network appliance?

About a year ago, I wrote a video player for a proprietary video format that uses WebAssembly, WebGL, and WebSockets. It was working great until the most recent versions of Chrome, which disable SharedArrayBuffer support unless there are a bunch of…
Timothy Miller
  • 1,527
  • 4
  • 28
  • 48