Пример #1
0
// this continuation function will be executed by an HPX thread
int cont1(hpx::unique_future<int> f)
{
    hpx::cout << "cont1 thread id: " << hpx::this_thread::get_id() << hpx::endl;
    hpx::cout << "Status code (HPX thread): " << f.get() << hpx::endl;
    hpx::cout << hpx::flush;
    return 1;
}
Пример #2
0
void null_callback(
    std::vector<double>& dd
  , boost::uint64_t j
  , hpx::unique_future<double> f
    )
{
    dd[j] = f.get();
}
Пример #3
0
// this continuation function will be executed by the UI (main) thread, which is 
// not an HPX thread
int cont2(hpx::unique_future<int> f)
{
    std::cout << "Status code (main thread): " << f.get() << std::endl;
    return 1;
}