MemoryCache: strategies to avoid locking
Currently, MemoryCache locks on all subscription requests to access the requested Flow. A possible alternative would to copy the entire backing map on each modification, so the current backing map would be read-only and thus not require locking.
Questions to answer:
- Is copying the entire array worth it?
- Is the global locking when acquiring a subscription a performance problem?