From: Eric Wong Date: 2018-05-04T00:16:50+00:00 Subject: [ruby-core:86871] Re: [Ruby trunk Misc#14735] thread-safe operations in a hash could be documented rr.rosas@gmail.com wrote: > result = {} # assume this is thread-safe in MRI for now > data_types.map do |data_type, processor| > Thread.start{ result[data_type] = processor.call } > end.each &:join It's only thread-safe in MRI if data_type is a common key type: String/Symbol/Integer/nil/true/false/Float > Is it just by chance? Yes, probably... > By the way, the 'concurrent' gem seems to assume Hash is thread-safe in MRI as you can see here: 'thread_safe' hit problems with that assumption: https://bugs.ruby-lang.org/issues/14357 Unsubscribe: