# Checking hash tables values in multithread environment

**URL:** <https://www.ruby-forum.com/t/checking-hash-tables-values-in-multithread-environment/189662>\
**Category:** Ruby\
**Created:** [June 4, 2010, 5:49pm UTC](https://www.ruby-forum.com/t/checking-hash-tables-values-in-multithread-environment/189662 "2010-06-04T17:49:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pollopoop92](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a6a055/32.png) [@pollopoop92](https://www.ruby-forum.com/u/pollopoop92)\
**Post date:** [June 4, 2010, 5:49pm UTC](https://www.ruby-forum.com/t/checking-hash-tables-values-in-multithread-environment/189662/1 "2010-06-04T17:49:09Z")

</div>

hi list,

i’m trying to create a system where i have a producer-consumer paradigm  
but with threads. Now i already created a mutex.  
My mainly problem is that the producer get output from many hosts and i  
have to store and check if i have, for each host, the same number of  
values collected. Now i think to use an Hash where i have ip\_address as  
key and as value the array of values collected by Producer.  
If the number of values for an host is reached, the consumer have to do  
something.  
This check work with a simple array but for multiple host, i dont know  
how to do it.

Kind regards,  
-Francesco V.
