Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm preparing a synchronous queue for the browsers. It's a queue that allows to send byte arrays between threads (workers) and it is based on SharedArrayBuffer and Atomics (subject to availability, currently works fine in Chrome, Firefox needs some reconfiguration). Early experiments show that it gives a 3-4x speedup comparing to using postMessage/onmessage. It also allows to synchronize some inherently asynchronous APIs, which is at times useful, especially when compiling C code to WebAssembly, as it often would have expectations of synchronous syscalls or other APIs.

There are still a few issues there I'd like to address before I publish it. Feel free to follow me on twitter (@yrashk) if you're interested, I'll announce it there.

I'm also considering making an experiment and publishing it under Prosperity license (https://licensezero.com/licenses/prosperity)



Looking forward to this library!

Would you consider adopting the MIT license? I could use a library like that for a work project and would be interested in collaborating on it.

Have you come across this library? https://github.com/bittnkr/uniq

> "A lock-free (multi reader / multi writer) circular buffered queue."

It has an algorithm that is easily translated to SAB + atomics. I'd be curious to know how the design of your library compares to uniq.

Thanks!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: