Shows how to run items of work asynchronously with Async.
#include <iostream>
int workItem0()
{
printf("Running workItem0...\n");
return 0;
}
void mt303_AsyncSimple()
{
printf("Running workItem1...\n");
return 1;
});
printf("Running something in the \"main\" thread\n");
std::cout << "The result of the work item 0 is " << wi0.get() << std::endl;
std::cout << "The result of the work item 1 is " << wi1.get() << std::endl;
printf("All work completed.\n");
}
{
mt303_AsyncSimple();
return 0;
}
- Author
- Danilo Piparo
Definition in file mt303_AsyncSimple.C.