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... Weiterlesen: GetOrAdd Ran My Factory Three Times
Intelligence View
⚡ tsecurity.de Intelligence
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…
Intelligence Digest — kostenlos Täglich die wichtigsten Security-News · jederzeit abbestellbar