You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A very nice starting example using std::future and std::async:
#include <iostream>
#include <future>
// Function to calculate Fibonacci number
int fibonacci(int n) {
if (n <= 1) return n;
return fibonacci(n - 1) + fibonacci(n - 2);
}
int main() {
// Launch asynchronous task
std::future<int> result = std::async(std::launch::async, fibonacci, 46);
// Do some other work while waiting for the result
std::cout << "Calculating Fibonacci(10) asynchronously..." << std::endl;
// Get the result from the future
int fib10 = result.get();
std::cout << "Fibonacci(10) = " << fib10 << std::endl;
return 0;
}
Make use of multithreading, possibly
std::future
and related classes.The Dependent tables should be created each in separate tasks. All tasks should be waited for to create the current table.
This depends on #24
The text was updated successfully, but these errors were encountered: