Assuming you have a multi-threading program, each thread may call a function from a DLL, and the function in that DLL will processing data in a multi-threading manner, in general, are there any peformance benefit/hit by doing this instead of make these functions in the DLL single-threaded?
Assuming you have a multi-threading program, each thread may call a function from a
Share
Maybe, maybe not. It depends on many things.
Firstly, spawning new threads is pretty expensive, so the amount of work that will be done in parallel will need to offset this cost.
Secondly, there need to be spare CPU cycles for those threads to actually run in parallel, and not be time-sliced onto the same core.
Lastly, the threads will need to be able to use those spare CPU cycles and not, for example, spend most of their time waiting for each other.