Menu
Sign inAccount

Without signing in, feed filters and “Main news today” still work in this browser.

All news
Techdev.to0 views

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

5 / 100
2
2
12 h
0.04
×1.2
3 h
GetOrAdd Ran My Factory Three Times — Arevian Pulse