Skip to content

Instantly share code, notes, and snippets.

@oliora
Last active August 29, 2015 14:07
Show Gist options
  • Save oliora/c8c8107534ba829f4e78 to your computer and use it in GitHub Desktop.
Save oliora/c8c8107534ba829f4e78 to your computer and use it in GitHub Desktop.
pseudo fork with C++11
void func_with_fork()
{
// local vars
auto r = std::async(std::launch::async, [&]() {
// forked thread code
});
// main thread code
r.wait(); // join with forked thread
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment