From: "ara.t.howard" Date: 2007-09-10T04:22:09+09:00 Subject: Re: Threading in ruby is retarded .....?~! On Sep 1, 2007, at 1:00 PM, Sal Syed wrote: > I'm running the latest version an Ruby and the way threads work makes > absolutely no sense to me... > > I have the simplest use of threads: > [code] > Thread.new do > while true > puts "Enter command" > if gets.chomp=='exit' > break; > > end > puts 'Ended service' > end > > Thread.new do > while service != nil > server.start > end end > > $user[:drbserver]=DistributedSearch.new($user,$database) > service=DRb.start_service("druby://localhost:#{$config[:drbport]}", > $user[:drbserver]) > DRb.thread.join > [/code] > this code won't run at all. post a complete, but minimal, example and someone might be inclined to fix it for you. as it stands i have no idea wtf????????? service or wft???????? server are. the code above has at least one race condition in it as it stands: you race here while service != nil and service = ... in some cases service will be nice the first time, in others not. perhaps this intended but, again, it's hard to see without a meaningful code posting. you'll have to help use help you if you want to get complete answer. regards. a @ http://drawohara.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama