3 ms·
Exactly the point: the goal of batching is to amortize the cost of synchronization over a large number of events. With enough events to amortize over, the cost
by ncmncm 6y ago
Exactly the point: the goal of batching is to amortize the cost of synchronization over a large number of events. With enough events to amortize over, the cost of synchronization drops into the noise. Then, you are better off avoiding bug-prone lock-free operations in favor of explicit lock operations that actual humans can reason about.
And get better throughput.
- NovaX 6y agoThis is known as BP-Wrapper, a batching and prefetching technique, that also coined the term lock amortization. Sometimes this is confused with flat combining, which came out a little later and is a slightly different concept. [1] https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.151.4102&rep=rep1&type=pdf https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.15... [2] http://ranger.uta.edu/~sjiang/pubs/papers/ding16_BP-wrapper.pdf http://ranger.uta.edu/~sjiang/pubs/papers/ding16_BP-wrapper....
- ncmncm 6y agoAmortizing batched operations across occasional overhead goes back to the mistiest origins of computation, and to industrial operations research before that. The very first brick-masons carried a hod of bricks to the top of their scaffold and then placed them before giing back for more. I promise you that practically nobody doing it has ever heard of "BP-Wrapper", or of flat-combining.
- NovaX 6y agoIn the context of concurrent programming they are well known. We are not discussing how to program a PDP-8 but how to efficiently design multithreaded algorithms. This article recommends Nir Shavit’s book, who has written many well known papers including flat combining.