CPU Usage

Community Forums/General Help/CPU Usage

BlitzMan(Posted 2016) [#1]
Hi Guys
I have seen a lot about CPU Usage lately,we have fore core,and even eight core
processors.Would that really make a diffrence to my program now days.If so why.
Thanks guys


Gabriel(Posted 2016) [#2]
If "your program" is made in Blitz3D or BlitzPlus then no, not at all. If it's made in BlitzMax then perhaps a bit, but only if what the code is doing actually suits being multi-threaded and only if you code it that way.

If you're talking about applications made by someone else, it can help enormously, but it depends on the application. Encoding video, if coded properly, can be massively quicker when multi-threaded. Something like MS Word which is mostly just windows forms and simple text processing, not so much.


EDIT: As for, "if so, why?" because you've got a four core CPU which is only using one if you don't multi-thread. If you're able to split the processing up into four sections and have each thread work on one of them, you just got (theoretically close to) a 300% speed boost.

Games generally don't multi-thread as well as heavy duty applications. Only recent renderers are capable of utilizing multiple cores at all and a lot of game code is not suitable for multi-threading. Games which have intensive physics and AI, for example, would benefit more than most. Perhaps games with heavy duty sound processing too.


xlsior(Posted 2016) [#3]
If you're able to split the processing up into four sections and have each thread work on one of them, you just got (theoretically close to) a 300% speed boost.


to a point -- in Blitzmax, only a single thread can draw to the screen, so creating multiple threads will not speed up drawing operations at all, just computationally heavy things like pathfinding, heavy calculations, etc.


Gabriel(Posted 2016) [#4]
Right. I think I covered that in my edit.


Grisu(Posted 2016) [#5]
You can do lots of useful things when you split your tasks to multiple threads. As a result your app will run smoother and faster. But for the basic blitz app, it's kind of overkill.