All news
GetOrAdd Ran My Factory Three Times
I had a client object that was expensive to build. It opens a pooled connection, reads a bit of config, and I only ever want one per name for the life of the process. So I did the obvious thing and cached it in a ConcurrentDictionary , keyed by name, built on first use with GetOrAdd . Thread-safe dictionary, lazy construction, done. Then I noticed the startup logs. For a single key, "opening…
Read at the source0 views
The story in one text
Summaries are not being written right now
How the order is made
- 2
- 2
- 12 h
- 0.04
- ×1.2
- 3 h
