Sarà solo restituire false se il dizionario non contiene un valore per la chiave dato o intende anche restituire false a causa di infilare condizioni di gara, come un altro thread aggiunge/aggiornamenti qualcosa?Quando si ConcurrentDictionary TryRemove return false
Domanda in codice:
ConcurrentDictionary<int, string> cd = new ConcurrentDictionary<int, string>();
// This might fail if another thread is adding with key value of 1.
cd.TryAdd(1, "one");
// Will this ever fail if no other thread ever removes with the key value of 1?
cd.TryRemove(1);
Edit: Penso che solo restituirà false se non contiene un valore per la chiave data, ma vuole essere assolutamente sicuro.