Hacker News new | ask | show | jobs
by elsamuko 4157 days ago
You can share resources between two threads, this is harder with processes.

The use case is, that you don't block the UI while doing heavy or slow work, e.g. generating previews in an image organizer or fetching http requests in a browser.

Instead of std::thread, I'd rather recommend using std::function and a threadpool like this one:

http://threadpool.sourceforge.net/