Open benaadams opened 2 weeks ago
Tagging subscribers to this area: @mangod9 See info in area-owners.md if you want to be subscribed.
Should the enumerator return values or references to the underlying storage? I assume the latter would be problematic due to making mutations from multiple threads possible?
Should the enumerator return values or references to the underlying storage? I assume the latter would be problematic due to making mutations from multiple threads possible?
Values; can always wrap with an object if want reference of values
Background and motivation
ThreadLocal<T>
is a good approach to gather uncontended metrics; however then collating those metrics viaThreadLocal.Values
is very allocatey.It would be better to provide a struct enumerator that can be iterated over for no allocations.
API Proposal
API Usage
Alternative Designs
No response
Risks
No response