hi,
I was wondering what is the best use in multicore threading. Big function with all the code a need or spleeping the code in many little function. And at the same time is multicore threading is better using the same function on all the core than using function1 on core 1 and 2 and function2 on core 3 and 4, for axample.
thanks.
The "right answer" is going to be determined by your algorithm, so it's very hard to give a generic answer that will be useful.
At a very high level ...
Multi-threading is usually a good thing if the algorithm allows it. Using more cores can give better performance for burst workloads, as well as better energy efficiency for sustained workloads.
Coarse division of work across threads is usually the most efficient way to do things. The smaller your pieces of work are, the more overhead you have synchronizing the threads, so fine-grained division has more overhead.
... but there are always exceptions to this ...