Page 1 of 1

Arrays of tasks

Posted: Thu Feb 21, 2019 10:28 am
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

Re: Arrays of tasks

Posted: Fri Feb 22, 2019 12:18 am
by akp