so for example:
Code: Select all
....
stdcoretype networkcore = stdcore[0];
stdcoretype monitorcore = stdcore[1];
...
main(void){
chan c;
..
on networkcore : start_eth(c);
on monitorcore : fetch_data(c);
..
}
Code: Select all
....
stdcoretype networkcore = stdcore[0];
stdcoretype monitorcore = stdcore[1];
...
main(void){
chan c;
..
on networkcore : start_eth(c);
on monitorcore : fetch_data(c);
..
}
Code: Select all
#define networkcore 0
#define monitorcore 1
main(void){
chan c;
..
on stdcore[networkcore]: start_eth(c);
on stdcore[monitorcore] : fetch_data(c);
..
}
Code: Select all
#include <platform.h>
core c0 = stdcore[0];
core c1 = stdcore[1];
core c2 = stdcore[2];
core c3 = stdcore[3];
void nothing()
{
}
int main()
{
par
{
on c0: nothing();
on c1: nothing();
on c2: nothing();
on c3: nothing();
}
return(0);
}
It should work in all cases.Folknology wrote:Assuming this technique will also work with L2s and 2 cores rather than 4?
I tried it on my XDK and it works fine - but, it doesn't seems to be supported by the spell-checker yet. The compiler likes it, but the spell-checker reports Syntax Error.m_y wrote:Assuming a G4...Code: Select all
#include <platform.h> core c0 = stdcore[0]; core c1 = stdcore[1]; core c2 = stdcore[2]; core c3 = stdcore[3]; void nothing() { } int main() { par { on c0: nothing(); on c1: nothing(); on c2: nothing(); on c3: nothing(); } return(0); }