Yeah, that's true. However, the order of thread execution wasn't on my radar because it didn't matter to the program I thought I was writing. It only started to matter when finding the source of the problem, which were the duplicate keys in the input.