Consider the following segment taken from a C program:
for(j = 1; j <=>
{
printf(“ nEnter an integer value:”);
scanf(“%d”, &x);
if(x == 0)
y(j)=0;
if(x != 0)
y(j)=10;
}
a. Recode it so it will run more efficiently in a single-processor system.
b. Given that a multiprocessing environment with four symmetrical processors is available, recode the segment as an efficient concurrent program that performs the same function as the original C program.
c. Given that all processors have identical capabilities, compare the execution times of the original C segment with the execution times of your segments for parts (a) and (b).
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here