B.5 Performance

It is instructive to compare the performance of the locked increment shown in Section [*] to that of per-thread variables (see Section [*]), as well as to conventional increment (as in ``counter++'').

@@@ need parable on cache thrashing.

@@@ more here using performance results from a modest multiprocessor.

@@@ Also work in something about critical-section size? Or put later?

The difference in performance is quite large, to put it mildly. The purpose of this book is to help you write SMP programs, perhaps with realtime response, while avoiding such performance pitfalls. The next section starts this process by describing some of the reasons for this performance shortfall.



Paul E. McKenney 2011-12-16