Lennie
Lennie

Reputation: 10845

GServer Thread Problems In Ruby

Looking around I found http://www.devco.net/archives/2008/06/26/adventures_with_ruby.php where the blogger moan about GServer's bug to destory threads and reaching its maximum connections. Is this problem real / still true?

Thanks

Upvotes: 1

Views: 237

Answers (3)

Chetan Muneshwar
Chetan Muneshwar

Reputation: 9

Eventmachine is awesome:

class Server

module Thread_server

  def receive_data data

    data.chomp
    {.......................}

  end
end

def self.perform

  EventMachine::run {

  EventMachine::start_server "xxx.xxx.xxx.xxx", pxoxrxt, Thread_server

  }

end

end

Upvotes: 0

tora
tora

Reputation: 11

I had also faced two problems with GServer in Ruby 1.9.1.

  1. It suddenly stops
  2. It does memory leaks

http://tora-japan.com/wiki/GServer_in_Ruby_1.9.1_has_two_problems

Then, I wrote a Pre-Threaded TCP Server for Ruby 1.9.1 by myself, linked from the wiki page above.

Upvotes: 1

csexton
csexton

Reputation: 24793

I had similar problems when using GServer as simple TCP server, however I didn't dig into the issue too deeply since I had originally planned to use EventMachine.

In the end I just ported my code to use that library and been happy.

Sorry, I don't know the real answer, but I do know that I had problems with GServer and have been really happy with EM since I switched -- so you might want to look into that. Replacing libraries was not too difficult once I understood how EM worked.

Upvotes: 0

Related Questions