[Mongrel] mongrel thread safety and global variables

hemant gethemant at gmail.com
Sat Sep 2 07:30:43 EDT 2006


Yes...its a multithreaded and supposed to server request flawlessly.

BTW, as a  quick check...i wrote a ruby program to fetch data for some 10000
iterations and and append it to a CSV file...and didn't get a single data
mangling error.

Next step, I will try 100 simultaneous threads, fetching the data and see if
there is a mis-match.



On 9/2/06, Luis Lavena <luislavena at gmail.com> wrote:
>
> 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
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users
>



-- 
nothing much to talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20060902/44a94857/attachment.html 


More information about the Mongrel-users mailing list