A few considerations for approximate counter designs

One thing that you may have noticed is that, even though only a single thread interacts with a single local counter, the data structure still has a lock attribute in its initialization. This is because it is, in fact, possible for multiple threads to share the same local counters. There are situations in which it is inefficient to create one local counter for every active thread, so the developer can have two or more share the same local counter instead, and individual counters can still report to the same global counter.

For example, suppose that there are 20 threads executing in a concurrent counter program; we can only have 10 local counters reporting to one global counter. From what we have seen, this setup will have a lower level of scalability than one with an individual local counter for each thread, but the advantage of this approach that it uses less memory space and avoids the overhead of creating more local counters.

There is another possible variation to the way in which a program that utilizes approximate counters can be designed. Instead of having only one layer of local counters, we can also implement semi-global counters that local counters report to, which, in turn, report to the global counters that are one level higher than themselves. When using the approximate counter data structure, the developer not only has to find, as discussed previously, an appropriate threshold of reporting, but he or she also needs to optimize the number of threads associated with one single local counter, as well as the number of layers in our design.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.186.109