Arrays of tasks

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
User avatar
RedDave
Experienced Member
Posts: 77
Joined: Fri Oct 05, 2018 4:26 pm

Arrays of tasks

Post by RedDave »

Suppose I have a task that receives a variable sized array of ports and/or interfaces.

Now suppose I need to launch one parallel task for each of these.

Code: Select all

void task(server interface if i[N], in port p[N], static const size_t N)
{
  par
  {
    subtask(i[0], p[0], 0);
    subtask(i[1], p[1], 1);
   ...
    subtask(i[N-1], p[N-1], N-1);
  }
}
Is there a notation for doing this?
I'm at a loss for what words to use when searching for it.

Ta,
Dave


User avatar
akp
XCore Expert
Posts: 578
Joined: Thu Nov 26, 2015 11:47 pm

Post by akp »

Post Reply