Hacker News new | ask | show | jobs
by valorzard 24 days ago
So if you are writing a WASM component model, and you were hoping to use Web Workers/SharedArrayBuffer, how would that work?

Do the virtual threads map on top of the Web Workers? Or are the Web Workers themselves green threads?

I was assuming Web Workers are OS threads

1 comments

That’s a great question and something we’re going to have to figure out going forward on the JS side.

What I can say now is that the first version will probably be single threaded stack switching coroutines, and the model that seems to fit most naturally in my head is virtual threads mapping to some worker thread n in a premade pool.