# Threadify not handling hashes inside of array correctly

**URL:** <https://www.ruby-forum.com/t/threadify-not-handling-hashes-inside-of-array-correctly/168929>\
**Category:** Ruby\
**Created:** [May 27, 2009, 1:46pm UTC](https://www.ruby-forum.com/t/threadify-not-handling-hashes-inside-of-array-correctly/168929 "2009-05-27T13:46:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![juuser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5f8ce5/32.png) [@juuser](https://www.ruby-forum.com/u/juuser)\
**Post date:** [May 27, 2009, 1:46pm UTC](https://www.ruby-forum.com/t/threadify-not-handling-hashes-inside-of-array-correctly/168929/1 "2009-05-27T13:46:50Z")

</div>

I wanted to use threadify to iterate over my data structure, where  
inside array I have hashes, but it seems that threadify produces  
different results than #each.

Here is code sample:  
require ‘threadify’

a = []  
b = {:key =\> “value”}  
a \<\< b

a.each {|c| p c}  
a.threadify {|c| p c}

Output is:  
{:key=\>“value”}  
[:key, “value”]

Now, if I have multiple key, value pairs in Hash, then I will get this  
warning of course:  
warning: multiple values for a block parameter (2 for 1)

Why isn’t threadify working as expected? It seems as it’s iterating over  
array and hash instead of just over array.

Jarmo

---

<div class="post-metadata">

**Author:** ![juuser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5f8ce5/32.png) [@juuser](https://www.ruby-forum.com/u/juuser)\
**Post date:** [June 2, 2009, 8:39pm UTC](https://www.ruby-forum.com/t/threadify-not-handling-hashes-inside-of-array-correctly/168929/2 "2009-06-02T20:39:24Z")

</div>

Forwarding conversationg with threadify’s author Ara T. Howard to the  
list:

On Tue, Jun 2, 2009 at 12:08 PM, Jarmo wrote:

> > Hello.
> > 
> > Do you still care about threadify and it’s problems? I’ve posted into  
> > Ruby list about one problem, but no-one doesn’t seem to bother to  
> > answer. I’ve searched for you as an author of this great library to see  
> > if you have any ideas about this problem.
> > 
> > You can read about it more from here:  
> > [http://groups.google.com/group/comp.lang.ruby/msg/1900149eb2817060](http://groups.google.com/group/comp.lang.ruby/msg/1900149eb2817060)
> > 
> > I would be grateful if you’d help me, but if you have something better  
> > to do then I’d also understand. Please just give me at least some answer 🙂
> > 
> > BR,  
> > Jarmo

i’m not on the list often these days - sorry i missed it.

fixed.

> **[GitHub - ahoward/threadify: threadify.rb makes it stupid easy to process a bunch...](https://github.com/ahoward/threadify/tree/master)**
>
> master

pls relay to list.

–  
-a  
– be kind whenever possible… it is always possible - h.h. the 14th  
dalai lama
