Concurrent add on non threadsafe HashSet - what is the worst that could happen?
问题 Situation: Multiple Threads are only adding values to a non threadsafe java.util.HashSet and no other operation is done on the Set until these threads have been stopped. Question: What is the worst that could happen? 回答1: That depends on what you consider as being "worst". I'm not sure whether this question aimed at a detailed, technical analysis of the current implementation considering all possible race conditions and the nitty-gritty details of the Java memory model. So if the question is: