From: Nathan Date: 2010-04-07T22:05:47+09:00 Subject: modifying a Hash in one process when .each is running in another I want one process to continually loop through a list of objects (in the form of a hash), while another process continually refreshes that list. I've done it the most obvious way below, but are there any pitfalls here? I don't really know how the each method works, so will it be looking for keys that may not be there anymore? Would I be better off doing some kind of merge of the old hash with the new, rather than replacing the old hash entirely? Any help much appreciated. Nathan tester = Thread.new { until terminate myHash.each do |key,value| value.test() end end } while Time.now < time_to_finish myHash = MyClass.generate_list_of_objects end terminate=true tester.join