On Sat, Apr 02, 2022 at 03:57:01PM +0800, Hao Lee wrote: > Hello, > > I'm confused about Figure 4.2 and the formula (4.1). > > Anyone can clarify the confusion? Thanks. > > On page 56, the book says: > > 1. LN is the number of lock acquisitions by N threads. > > Question: Does this mean LN = sum of all the readcounts[i] ? Yes. > 2. L1 is the number of lock acquisitions by a single thread > > Question: which thread is L1 corresponding to? Is "a single thread" > selected randomly? No, L_1 corresponds to the number of acquisitions of a single thread in a run where only that one thread was running. And now that you mention it, the text does not make that at all clear, so please accept my apologies for the unclarity. Does the change below help? The resulting text is: where N is the number of threads in the current run, L_N is the total number of lock acquisitions by all N threads in the current run, and L_1 is the number of lock acquisitions in a single-threaded run. Where the LaTeX "_" subscript operator is used in place of real subscripts. Thanx, Paul ------------------------------------------------------------------------ commit 432a94b0b7e1436a00587a0988fb678def465882 Author: Paul E. McKenney <paulmck@xxxxxxxxxx> Date: Sat Apr 2 08:30:43 2022 -0700 toolsoftrade: Clarify rwlock efficiency formula description Reported-by: Hao Lee <haolee.swjtu@xxxxxxxxx> Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx> diff --git a/toolsoftrade/toolsoftrade.tex b/toolsoftrade/toolsoftrade.tex index 833ec697..d6662f8c 100644 --- a/toolsoftrade/toolsoftrade.tex +++ b/toolsoftrade/toolsoftrade.tex @@ -890,9 +890,10 @@ The actual value plotted is: \begin{equation} \frac{L_N}{N L_1} \end{equation} -where $N$ is the number of threads, -$L_N$ is the number of lock acquisitions by $N$ threads, and -$L_1$ is the number of lock acquisitions by a single thread. +where $N$ is the number of threads in the current run, +$L_N$ is the total number of lock acquisitions by all $N$ threads in the +current run, and +$L_1$ is the number of lock acquisitions in a single-threaded run. Given ideal hardware and software scalability, this value will always be 1.0.