From: otaku Date: 2004-09-12T02:10:01+09:00 Subject: Re: Net-SSH Threaded PortForward Script Problems Justin, i am not sure the syntax is correct however its looking like perhaps you may be correct in regard to the race condition the Programming Ruby book provides an example of using mutex require 'thread' mutex = Mutex.new count1 = count2 = 0 difference = 0 counter = Thread.new do loop do mutex.synchronize do count1 += 1 count2 += 1 end end end spy = Thread.new do loop do mutex.synchronize do difference += (count1 - count2).abs end end end