4 ms·
Just to inform the reader, the experimental WebGPU API does embrace async communications with rendering devices: https://developer.mozilla.org/en-US/docs/Web/AP
by qprofyeh 3y ago
Just to inform the reader, the experimental WebGPU API does embrace async communications with rendering devices: https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice
- throwawaymaths 3y agoIt's still not the same, because of the way js async works
- qprofyeh 3y agoCurious why that is. How does V8 handle it differently?
- throwawaymaths 3y agoV8 is asynchronous but single threaded, elixir gets m:n threaded. Job cancellation is trivial, safe, and automatically recovers the resource in elixir (the gpu devs have hooked cleanup in to the BEAM GC, because that is a thing). Moreover, if the caller of the agent asynchronously controlling the gpu is cancelled, it will also release the gpu automatically (in most cases, if you use the stdlib otp features instead of trying to build with primitives)
- qprofyeh 3y agoAFAIK V8 does make use of threads internally via libuv in order to make truly concurrent system calls. GPU device comms should fit perfectly in that design.