Such is the task: you need to generate placements with repetitions from n to k. This will be n ^ k elements. If n = 2, k = 128, then the generation time will be, let's say, considerable) It is also well known that the standard program does not use all the power of the processor, but only loads it by 5-6 percent. So the actual question is: how can I use all the power of my dual-core processor and in turn reduce the generation time for placements?
If the program only does that all the time something thinks, then ONE processor core will be loaded completely. In order to fully load both cores, it is necessary to make two threads, between which to divide the calculations and somehow synchronize them. This is the simplest example of parallel computing.
You can program threads manually using the operating system API, you can use wrappers like Boost.Threads or C ++ 11 threads. You can apply some kind of framework. Especially useful for this OpenMP task.