Solved

How Would You Rewrite the Following Sequential Code So That

Question 4

Essay

How would you rewrite the following sequential code so that it can be run as two parallel threads on a dual-core processor ? Try to balance the loads as much as possible between the two threads:
int A[80], B[80], C[80], D[80];
for (i = 0 to 40)
{
A[i] = B[i] * D[2*i];
C[i] = C[i] + B[2*i];
D[i] = 2*B[2*i];
A[i+40] = C[2*i] + B[i];
}

Correct Answer:

verifed

Verified

The code can be written into two threads...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions