« Many BBC Basic programs running at the same time »

Welcome Guest. Please Login or Register.
Mar 31st, 2018, 10:43pm

ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Cross-platform BBC BASIC (Windows, Linux x86, Mac OS-X, Android, iOS, Raspberry Pi)
BBC BASIC Resources
BBC BASIC Help Documentation
BBC BASIC for Windows Home Page
BBC BASIC Programmers' Reference
BBC BASIC Beginners' Tutorial
BBC BASIC for SDL 2.0 Home Page
BBC BASIC Discussion Group

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Many BBC Basic programs running at the same time  (Read 336 times)
Full Member

member is offline



Posts: 157
xx Many BBC Basic programs running at the same time
« Thread started on: Aug 10th, 2017, 01:05am »

I had a thought that it may be possible to achieve massive speeds in graphics if say I had many programs using the same graphics.

So here is the theory:
Get other multiple programs on standby mode so they don't interfere with the upcoming graphics screen.

Get the LAST program to set up the graphics full screen and get its own series of actions working on screen.

Once the screen is active, then the other programs could sense a color and when that color appears, they would sync.

Does this sound possible Richard?

The last Graphics screen should override the inactive windows and the graphics should plot. Windows should multitask each program in its own thread.
User IP Logged

I like reinventing the wheel, but for now I will work on tools for D3D
Richard Russell

member is offline


Homepage PM

Posts: 803
xx Re: Many BBC Basic programs running at the same ti
« Reply #1 on: Aug 10th, 2017, 08:35am »

on Aug 10th, 2017, 01:05am, michael wrote:
I had a thought that it may be possible to achieve massive speeds in graphics if say I had many programs using the same graphics.

Putting graphics to one side, it's certainly true that the way to get the best performance from a modern multi-core or multi-CPU PC is to run multiple threads or processes at the same time, so that you can leverage the parallelism available. I have a BBC BASIC program that makes heavy use of three cores on a fast four-core PC to process high-definition video in real time.

Graphics is something of a special case, however, because of the presence of the GPU. If you have a powerful GPU, of the kind found in 'gaming' PCs, you will probably get better results from offloading as much as possible of the graphics processing onto the GPU, before worrying about spreading it between CPU cores. Of course if you can do both (e.g. the CPU doing calculations and the GPU plotting) you may get the best of both worlds.

Unfortunately, making the most of the GPU when programming in BBC BASIC is not so easy. When you can take advantage of Direct3D (on Windows) or OpenGL (on other platforms) then you should do so, because usually the back-end processing will be done on the GPU in that case. To take control of the GPU at a lower level typically means writing code in High Level Shader Language (HLSL) which gets compiled and loaded into the GPU. You can do that from BASIC (Michael Hutton produced some examples in the old days) but there's a steep learning curve.

But, yes, you can attempt to spread graphics processing between multiple BBC BASIC programs if you can overcome the problems of synchronisation and sharing of the graphics output. For the latter I would recommend creating a shared DIB Section: the CreateDIBSection API has the capability of forcing the DIB to be resident in a file mapping object, which can be shared between multiple processes. You could then divide up the graphics processing between multiple instances of BBC BASIC, all of which are writing to the same DIB Section.

I've never attempted that myself but it sounds like an exciting and challenging thing to try, so I look forward to learning what success you have.

User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls