Question: COULD YOU PLEASE HELP ME FOR MY HOMEWORK PLEASE... The gain is that some experience with writing concurrent code and measuring its performance. Learning to
COULD YOU PLEASE HELP ME FOR MY HOMEWORK PLEASE... The gain is that some experience with writing concurrent code and measuring its performance. Learning to build code that performs well is a critical skill and thus gaining a little experience here with it is quite worthwhile. Questions Well start by redoing the measurements within this chapter. Use the call gettimeofday to measure time within your program. How accurate is this timer? What is the smallest interval it can measure? Gain confidence in its workings, as we will need it in all subsequent questions. You can also look into other timers, such as the cycle counter available on x via the rdtsc instruction. Now, build a simple concurrent counter and measure how long it takes to increment the counter many times as the number of threads increases. How many CPUs are available on the system you are using? Does this number impact your measurements at all? Next, build a version of the sloppy counter. Once again, measure its performance as the number of threads varies, as well as the threshold. Do the numbers match what you see in the chapter? Build a version of a linked list that uses handoverhand locking MS as cited in the chapter. You should read the paper first to understand how it works, and then implement it Measure its performance. When does a handoverhand list work better than a standard list as shown in the chapter? Pick your favorite data structure, such as a Btree or other slightly more interesting structure. Implement it and start with a simple locking strategy such as a single lock. Measure its performance as the number of concurrent threads increases. Finally, think of a more interesting locking strategy for this favorite data structure of yours. Implement it and measure its performance. How does it compare to the straightforward locking approach?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
