cds
2.3.2
|
[type-option] Option setter for item counting More...
#include <cds/opt/options.h>
[type-option] Option setter for item counting
Some data structure (for example, queues) has additional feature for item counting. This option allows to set up appropriate item counting policy for that data structure.
Predefined option Type:
atomicity::empty_item_counter
- no item counting performed. It is default policy for many containersatomicity::item_counter
- the class that provides atomic item countingatomicity::cache_friendly_item_counter
- cache-friendly atomic item counteropt::v::sequential_item_counter
- simple non-atomic item counter. This counter is not intended for concurrent containers and may be used only if it is explicitly noted.You may provide other implementation of atomicity::item_counter
interface for your needs.
Note, the item counting in lock-free containers cannot be exact; for example, if item counter for a container returns zero it is not mean that the container is empty. So, the item counter may be used for statistical purposes only.