4 ms·
An older but similar approach from Doom III engine: http://fabiensanglard.net/doom3_bfg/threading.php http://fabiensanglard.net/doom3_bfg/threading.php I wonde
by rawnlq 10y ago
An older but similar approach from Doom III engine: http://fabiensanglard.net/doom3_bfg/threading.php http://fabiensanglard.net/doom3_bfg/threading.php
I wonder if there is a good open-sourced C++11 project for this pattern? (a job/task queue)
Also how does this pattern compare with just using future/promises with a parallel executor?
https://code.facebook.com/posts/1661982097368498/futures-for-c-11-at-facebook/ https://code.facebook.com/posts/1661982097368498/futures-for...
or grand central dispatch from objective C?
- lbrandy 10y agoOur (facebook's) folly library has lots of components for doing stuff using fibers[1]. That sits with folly::futures[2] and wangle[3]. That said, without proper language/compiler support, though, it's difficult to make them "safe" (for some definition). Even within fb, given these libraries, we are pretty wary of using fibers with C++ unless absolutely necessary. You gotta really need it. This is where the coroutines proposals working their way through the C++ committee can make lives better. [1] https://github.com/facebook/folly/tree/master/folly/fibers https://github.com/facebook/folly/tree/master/folly/fibers [2] https://github.com/facebook/folly/tree/master/folly/futures https://github.com/facebook/folly/tree/master/folly/futures [3] https://github.com/facebook/wangle https://github.com/facebook/wangle