Noticed this while working on my current engine. SDL2 when just running a main thread will have a secondary thread that appears to be created by SDL itself but it always runs for me on hardware core nine.
System has 6 cores 12 threads. Just to clarify.
It wouldn’t be so bad if the affinity for it was at least set between 0 and 3. Then it would be easy to make use of the other threads. As it is if I tried to use full amount threads the system will place one of them on top of the two currently used threads. I can set the affinity of the primary thread and threadpool threads. I can’t however do anything about the one created by SDL.
As it is I am left doing a performance check to identify what threads are being used by the game initially then set the affinity of the ones I created to values the others aren’t.
That’s a serious pain. I wouldn’t expect someone with any less knowledge to try it.
So if the affinity is at least limited to the first 2 CPUs or 4 threads That would make multithreading a much easier and viable task for others.
I did notice in the library source threads appear to be used quite a bit. I’m a bit surprised I didn’t see more threads in use. Guess I’ll need to look deeper into it and see what is going on.