Call same function from more cores Topic is solved

If you have a simple question and just want an answer.
tilde
Member++
Posts: 22
Joined: Fri Nov 07, 2014 9:03 am

Call same function from more cores

Post by tilde »

Is it possible to call same function from two cores(, but on same tile)?

The function which I used is especially the function: db_to_mult() from xmos audio class tutorial on xc200_MC kit. Function db_to_mult() uses one global variable: static unsigned coef[14], which is used like a constant.
I call it from endpoint0 and buffer core, too. They are on same tile. I can compile it, it works, but I m afraid about stability.


With kind regards
Tilde
View Solution
User avatar
akp
XCore Expert
Posts: 579
Joined: Thu Nov 26, 2015 11:47 pm

Post by akp »

This function will be fine. The global isn't modified so there's nothing to worry about. The two calls will run with completely separate context so it will work no problem. I would have used static unsigned const coef[14] or something like that just to make it clear.
tilde
Member++
Posts: 22
Joined: Fri Nov 07, 2014 9:03 am

Post by tilde »

Thanks!
With kind regards
Tilde