Cuberite Forum

Full Version: Concurrency - Lambda based message passing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Ok. Let's leave it as is.
Damn. I'm halfway through such a rewrite :P
This seems like your halfway to an async/await style system. The multithread callbacks have a lot of issues with nesting if you use lambdas not promises, and captures will cause problems regardless.
Like worktycho said, futures/promises are the way to go for something like this.
https://github.com/progschj/ThreadPool/b...readPool.h is a pretty good example of an async work queue with futures.
Pages: 1 2