Write parallel programs to compute n! in each of the following ways and assess their performance. The number, n, may be odd or even but is a positive constant. (a) Compute n! using two concurrent processes, each computing approximately half of the complete sequence. A master process then combines the two partial results. (b) Compute n! using a producer process and a consumer process connected together. The producer produces the numbers 1, 2, 3, … n in sequence. The consumer accepts the sequence of numbers from the producer and accumulates the result; i.e., 1 × 2 × 3 … .
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here