|
|
|
|
|
|
|
|
|
|
What's News in the PlayBasic world ? - Find out here.
Threading / Multi Core Support
|
By: Kevin Picone Added: October 9th, 2012
|
Category: All,Upgrade
|
The home computing landscape has changed dramatically in the ten years since PlayBasic birth. One such change, has been the rapid addoption rate of multi core CPU's. To the point where they're common place in even mobile phone and tablet devices. The concept behind adding multiple cpu's to a computer is simple, it allows the operating system and software to split the work load between the separate devices, improving the overall performance of the system and individual software.
The only problem with all this hardware evolution, is that software has to be explicitly written to use the extra cpu cores a system might have. Traditionally programs work in a linear fashion, completing a series of tasks all in the order. However on a Multi core system, it can be more efficient to separate tasks and run them in parallel. Moving from a linear to parallel thinking can be rather problematic, as such, it's generally not something BASIC styled programming language offer users, let alone those brand new to programming
With PlayBasic V1.64N3 upgrade (retail) we're including multi core (threading) support in the BlitImage library. The BlitImage library is a series of drawing functions for either merging or post processing. These functions are generally used on full screen effects, making them perfect candidate for threading. To utilize threading, the programmer only has to enable it, then call the required BlitImage function. This task is then pushed off on the secondary core in your system.
So what our programs will be doing, is shifting these large effect renders out of our main program. Once the threaded function is called, our program doesn't wait for this to complete, since there's no advantage in that, rather it continues running as normal. It's here, that we have to start thinking in parallel, as to take advantage of such sharing, we'll need to write our programs so doing some other calculations, while the rendering is occurring on another core.
Separating the big rendering task from our main program, can potentially make the rendering task free. Doubling the performance of the section of the code. Which is well worth exploring !
Work In Progress
We recommend checking out the V1.64N2 WORK IN PROGRESS GALLERY for more insights into the latest additions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|