Operating Systems Course: CO20-320202 Homework 2 solved

$30.00

Category: Tags: , , , , You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (3 votes)

Global Lock Iterative Lock Coin Lock
P=100
N=10000 84.979 ms 910.957ms 7528.29ms
P=200
N=10000 182.203ms 1883.923ms 14234.256ms
P=100
N=100000 782.011ms 9604.915ms 78482.832ms
P=200
N=50 15.076ms 14.51ms 49.678
Upon running the program several times. Each time with different parameters. It can be seen that
runtimes increase for every strategy with the increase of the number of threads (P) and flips(N).
The table shows that the Coin lock has the lowest runtime. While the Global lock has the fastest
runtime. This is due to the fact that the Global lock has the largest amount of code in critical
section and the overhead of locking and unlocking it is less then the coin lock method.
However, upon having an amount of flips tht is lower then the amount of threads; it appears that
the Iterative lock takes the lead in becoming the fastest to complete the assigned amount of flips.