[Mongrel] mongrel thread safety and global variables

Luis Lavena luislavena at gmail.com
Sat Sep 2 02:34:29 EDT 2006


On 9/1/06, hemant <gethemant at gmail.com> wrote:
>
> We initially chose UNIXSocket over TCPSockets, because of performance
> reasons.
>
> As it turns out, its not so scalabale..so we may scrap it.

Ok, is your UNIXServer implemented in a multithread fashion? (so it
could hadle multiple clients to connect).

how its coded?

Like this:

require 'socket'
SOCKET = "/tmp/sample"
server_thread = Thread.start do # run server in a thread
  sock = UNIXServer.open(SOCKET)
  s1 = sock.accept
  p s1.recvfrom(124)
end

client = UNIXSocket.open(SOCKET)
client.send("hello", 0)
client.close
server_thread.join

I compared unix sockets to windows pipes... which is wrong, my mistake.

Have you tried connect to ruby clients in the same machine to the
running socket server?

If that works, then your problem could be... anything ;-) (just kidding)

-- 
Luis Lavena
Multimedia systems
-
Leaders are made, they are not born. They are made by hard effort,
which is the price which all of us must pay to achieve any goal that
is worthwhile.
Vince Lombardi


More information about the Mongrel-users mailing list