Question: hello please help. to be completed in c. Please show all work. thank you finna learn Parallel efficiency! Have an array arr of 100.000 elements

hello please help. to be completed in c. Please show all work. thank you finna learn hello please help. to be completed in c. Please show all work.

Parallel efficiency! Have an array "arr" of 100.000 elements filled with random numbers between 0 and 9. Fork in away to achieve 2 processes which find how often a "3" is in the array simultaneously. After both are finished, add the result of both processes and print them. Hint: You gonna need mmap twice, for the array and for storing the result of the child, so that the parent later can add its own result and print the sum! Don't forget to munmap later or points minus! Random numbers between 0 and 9: #include 1 srandLand #include time int main() srand (time(NULL)); //Initialize random seed. That's important and comes right at the start of the main function and only once, never again. int randomnumber = rand() $10; // random number from to 9 1 Filename: random.c so that 4. Forking (10 points) Print your full name and your favorite city! Do it in the order: ho [Firstname) (Middlename] [Lastname) [favorite city), with one space between the items. Use four processes (fork and wait) to do the trick, see figure. If you do not have a middlename-choose one! Filename: fork.c

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!