3 ms·
You can look into asio or boost::asio (same thing more or less). These libraries add pretty good async behavior. Of course, you need to know a lot of C++ to und
by lionkor 3y ago
You can look into asio or boost::asio (same thing more or less). These libraries add pretty good async behavior. Of course, you need to know a lot of C++ to understand and use them properly, and they're very verbose.
If you need to do things in parallel for performance, you may be better off spinning up a threadpool (like asio's thread_pool) and using a threadsafe queue or similar (i.e. asio's asio::post()) to pass messages and get results.
Since you can do it with JS, you likely don't have massive perf requirements, and you just need to write it in simple, synchronous C++ and you may find it to be well fast enough.
We also have coroutines, they're async/await. Haven't tried them though.