Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Focus On Geodatabases In ArcGIS Pro

Authors: David W. Allen

1st Edition

1589484452, 978-1589484450

More Books

Students also viewed these Databases questions

Question

Explain the difference between the total PMPM and a premium rate.

Answered: 1 week ago