Help Setting up Multicore #559
-
|
Hi [ please bear with me I am not an experienced C++ person ] I have been studying the Mandelbrot example in the Circle Samples folder I think I have understood it, and have implemented a class for it, based But my questions is, how do I set Core 1 running with a subroutine, from From the Madelbrot example, it never returns to the Kernel::Run sub so Any help greatly appreciated. CMC_tasks.h CMC_tasks.cpp |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
The communication between multiple cores is part of the magic of an multi-core application and one could probably write books about this. That's why I can only give an example. First you have to know, that a variable, which is defined in a Circle multi-core app is visible on all cores. So if you write to this variable on one core, an other core can watch this. So variables can be used for communication between multiple cores. Unfortunately you cannot directly call a subroutine from one core on another core. All cores run their one code, normally in a loop, and process the data, they are working on. But they can communicate, if they share some of this data. It depends on, what your application is doing, how this could look like in detail. The sample/17-fractal is special in this point, because here each core calculates a part of a Mandelbrot image, they write the resulting pixels to an area in the frame buffer, which is reserved for them, and they are working on a parameter range, which is already known, when the cores are starting their calculation. So no communication is necessary between them. A more complex example is the MiniSynth Pi audio synthesizer application. Here each core has to calculate the next audio sample values for 6 active voices (24 voices total). Core 0 controls, when the secondary cores (1, 2, 3) are starting their calculation. This is done in the class CVoiceManager with the variable The overlying logic calls CVoiceManager::NextSample(), when the next audio sample is needed. Now core 0 kicks the secondary cores by setting their value in Now let's watch, what the secondary cores did in the meantime in CVoiceManager::Run(). Each secondary core in a loop first waits for its This is one possible inter-core communication scenario. It depends on, what your application is doing, if you can reuse this or need an other protocol. |
Beta Was this translation helpful? Give feedback.
The communication between multiple cores is part of the magic of an multi-core application and one could probably write books about this. That's why I can only give an example.
First you have to know, that a variable, which is defined in a Circle multi-core app is visible on all cores. So if you write to this variable on one core, an other core can watch this. So variables can be used for communication between multiple cores.
Unfortunately you cannot directly call a subroutine from one core on another core. All cores run their one code, normally in a loop, and process the data, they are working on. But they can communicate, if they share some of this data.
It depends on, what your applica…