S
Sal Syed
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:
When I run this DRb does NOT start until after I type in exit! Why does
a new thread block the main thread wtf?????? I'm guessing this is not
normal and has something to do with either DRb or Webrick. Isn't there a
way that these two would just run their own threads...? It makes it
useless to me if I can't run both in the same program
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
When I run this DRb does NOT start until after I type in exit! Why does
a new thread block the main thread wtf?????? I'm guessing this is not
normal and has something to do with either DRb or Webrick. Isn't there a
way that these two would just run their own threads...? It makes it
useless to me if I can't run both in the same program