Regarding Parallel Operation

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
lokesh327
Member++
Posts: 29
Joined: Wed Feb 06, 2013 2:24 pm

Regarding Parallel Operation

Post by lokesh327 »

Hi,

I am using a parallel operation to run two while loops. I have made time analyis of the both while loops.

par{
while(1)
{
abcd;
}
while(1)
{
efgh;
}

}


1st while loop takes 950ns
2nd while loop takes 1.71us

how should i calculate the maximum time consumed for the parallel operation. Is it the maximum time consumed in either loops or any other way to calculate max time for the parallel opration for one iteration


User avatar
segher
XCore Expert
Posts: 844
Joined: Sun Jul 11, 2010 1:31 am

Post by segher »

You do not _have_ any iteration of the parallel operation; both loops
run completely independently in your code. Synchronise them (via a
channel, perhaps) if you want the two loops synchronised; the time
it then takes for one iteration is the maximum of the time for one
iteration of either loop.
lokesh327
Member++
Posts: 29
Joined: Wed Feb 06, 2013 2:24 pm

Post by lokesh327 »

Hi Segher,

Thanks for your reply, I have done the same and thanx for the clarification of doubt as time constraints are important in my case