Use any C program without using PTHREADS calculate time taken to execute program. Write same program of question...

80.2K

Verified Solution

Question

Programming

Use any C program withoutusing PTHREADS calculate time taken to executeprogram.

  1. Write same program of question 1 using PTHREADS.Calculate time taken to execute program.(1 mark)
  2. Identify data races in above program and explain whythis situation occurred with an example (1 mark)
  3. Rewrite the code to avoid data races should use any ofthe THREE techniques.(1.5 marks)

please I need the c code..

critical section

mutex solution

semaphore functions

Barriers

Read-Write Locks

Run program using 1, 2, 4, and8 threads Comparison study (1.5 marks)

Number of threads

Implementation

1

2

4

8

critical section

mutex solution

semaphore functions

Barriers

Read-Write Locks

  1. Rewrite the program using OPENMP. Run on 4 processors.Calculate time taken.
  2. At the end calculate speed up.

Answer & Explanation Solved by verified expert
3.6 Ratings (293 Votes)
    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students