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: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>