Which thread-safe collection in the .Net Framework has a “Contains” as one of its API? -


i know concurrentdictionary has api called containskey, dictionary not i’m looking for. now, using “contains” extension method enumerable, method not thread-safe. there thread-safe collection has “contains” method?

thanks.

in general, contains operation not useful in concurrent collection. problem that, determine collection "contains" or doesn't contain object, logic result of check no longer valid, thread may have added or removed item following.

the concurrentdictionary class contains method implement idictionary, intended usage use addorupdate, getoradd, , similar atomic methods.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -