- Exercise

Let's solve an exercise in this lesson.

We'll cover the following

Problem statement #

Parametrize the summation of the natural numbers in the program in such a way that the number of threads depends on the value of std::thread::hardware_concurrency().

If we get the result 0, assume we have four threads.

Get hands-on with 1000+ tech skills courses.