Closed mapleFU closed 6 months ago
@Huberyxiao would you mind take a look?
In this scenario, the value is assigned to a conventional data structure, and no memory issues arise. However, this may lead to concurrency problems. The Get method returns a reference after releasing the lock, and subsequently, a copy operation is performed externally. During this process, if there is a concurrent Put method invocation, concurrency conflicts may occur. To address this issue, we consider altering the Get method to return a value type object instead of a reference
Yeah this is what I mean. Seems DNS cache would use it, it would raise problem when concurrently put/get the dns
Return a reference, when LRU Put is high and cache size isn't too many, might causing memory issue?