Estimate time overhead that your spinlock implementation use


Problem

If you were to replace all mutexes with spinlocks, what do you think will happen to the running time? Write short answer describing what you expect to happen, and why the differences in mutex vs. spinlock implementations lead you to that conclusion (it's okay if your intuition turns out to be wrong, but start with this answer first).

Now, copy your parallel_mutex.c code to parallel_spin.c; we're going to test your hypothesis by replacing all mutexes with spinlocks (things like pthread_mutex_t become pthread_spinlock_t, and pthread_mutex_lock becomes pthread_spin_lock).

Once these modifications have been made, show another line plot with the x-axis being the number of threads, the y-axis being the time taken to complete, and three lines as the series (one for original/unsafe, one for mutex-based, and one for spinlock-based)

Lastly, estimate the time overhead that your spinlock implementation uses and explain your estimate.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Estimate time overhead that your spinlock implementation use
Reference No:- TGS03276363

Expected delivery within 24 Hours