Search⌘ K

Exercise

Explore writing concurrent programs and measuring their performance using timers and locking methods. Implement a concurrent counter, sloppy counter, and hand-over-hand locked linked list. Evaluate performance across threads and locking strategies to understand how concurrency impacts data structures.

We'll cover the following...

In this exercise, you’ll gain 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.

You will have to attempt this exercise locally, however, feel free to discuss your insights on the Discuss thread.

Questions

  1. We’ll start by redoing the measurements within this chapter. Use the call gettimeofday() to measure time within your program. How accurate is ...