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

I think the idea is that you're using some external library (e.g. database drivers) which do not use asio but returns a std::future. You can't just "not use std::future" if that's what your library uses without fully rewriting your external library.

The other option is as you mention polling using a timer, but I don't see how that's better, I'd rather move the work off of the event loop to a thread. And you then have to do the "latency vs. CPU time" tradeoff dance, trying to judge how often to poll vs. how much latency you're willing to accept.



I'd argue using third-party libraries in a C++ project is a bad idea to begin with. Bad ones especially.




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

Search: