4 ms·
I've been playing with wait-free algorithms some time ago but never got anywhere meaningful. A wait-free queue for multiple consumers and multiple producers wo
by svckr 10y ago
I've been playing with wait-free algorithms some time ago but never got anywhere meaningful.
A wait-free queue for multiple consumers and multiple producers would be kind of the holy grail when it comes to wait free data structures. Is it MPMC though? I skipped through the PDF and could not find a definitive claim…
Also, big thumbs up to Chaoran for putting the implementation on GitHub: https://github.com/chaoran/fast-wait-free-queue https://github.com/chaoran/fast-wait-free-queue
The code looks like it is easy to follow and it's MIT licensed.
- OJFord 10y agoAh! I thought I recognised that name/domain. He previously saved my bacon with `node-finish` - a Node.JS library that let's you fire off a bunch of tasks, and wait for _all_ to finish before executing a callback. What a hero.
- rco8786 10y agoPromise.all?
- striking 10y agoBut for callbacks, which is much more of a pain. There was a time before Promises, you know.
- rco8786 10y agoOP said "recently". Even before Promises, wrapping up some callback functions and tracking async task state isn't rocket surgery.
- OJFord 10y ago> OP said "recently". I did? I think you misread my "previously". Regardless, I was new to JS and not up to the task of implementing it myself. @chaoran's library did exactly what I needed. An appreciative note didn't need to turn into criticism of the project's worth.
- colanderman 10y agoYes, it's MPMC. Progress guarantees are only really meaningful for multiple readers/writers. (If you have only one reader/writer, and it dies, who cares if the writers/readers on the other side keep working? Your system's hosed anyway.)