Re: Distance Rendering
Posted: 26 Nov 2018, 18:09
Unless the underlying data structures are amenable to it, in general, making something use more cores doesn't make it faster, it actually makes it slower. Lots of things require the ability to access other bits of data, and if there might be another thread making changes to that data at the same time, you need some kind of lock or mutex so that each thread can read the data either before it gets changed or after it gets changed, but not while it was halfway through being changed and doesn't make any sense. Doing so requires messages to be passed between cores by some mechanism, and this is really slow in comparison with most other tasks a CPU does. If you split some work across four cores, you might expect it to take a quarter as long to finish, but when the performance hit of inter-thread communication is taken into account, it might not be any more.
This is analogous to how if you have a group of twenty people and ask them to write one sentence of a letter each, only communicating to each other by writing messages onto paper aeroplanes and throwing them to each other's desks, it's going to take a lot longer to have a sensible letter than if you'd just asked one of them to write the whole thing.
In the case of the draw thread, splitting it onto multiple threads would be more like asking them to also type their sentence out on a typewriter, but you only give them the one typewriter and don't let anyone leave their desk, so the typewriter would need to be thrown from desk to desk, too. OpenGL and DirectX 11 and earlier are like the single typewriter - they can only be accessed from one thread at once.
This is analogous to how if you have a group of twenty people and ask them to write one sentence of a letter each, only communicating to each other by writing messages onto paper aeroplanes and throwing them to each other's desks, it's going to take a lot longer to have a sensible letter than if you'd just asked one of them to write the whole thing.
In the case of the draw thread, splitting it onto multiple threads would be more like asking them to also type their sentence out on a typewriter, but you only give them the one typewriter and don't let anyone leave their desk, so the typewriter would need to be thrown from desk to desk, too. OpenGL and DirectX 11 and earlier are like the single typewriter - they can only be accessed from one thread at once.