From: "Ara.T.Howard" Date: 2004-08-17T03:11:00+09:00 Subject: Re: FastCGI and threads On Mon, 15 Aug 2004, George Moschovitis wrote: > Somewhat related to the earlier post: > > Some time ago another ruby user tried UNSUCCESSFULLY the following code: > > FCGI.each do |fcgi| > Thread.new(fcgi) { |f| > f.out.print "Content-type: text/html\r\n\r\n" > f.out.print f.out.type, "
\n" > ... > } > end > > matz replied: > > fcgi is not thread-safe. Unlike other IO facilities, it does not try to > avoid IO blocking. I'll make fcgi thread-safe soon (or I hope someone > voluneer to update it). > > Is fcgi thread safe now ? Can code like this work with fcgi? > > thanks in advance, > > George Moschovitis what will this buy you? fastcgi is process based from apache's point of view - it's not going to send another request until it gets all the output from the first one so this approach buys you nothing. in fact, it should slow a fastcgi process down since it now has the cost of creating a thread for every request. also, if the load is very high for a particular fcgi program mod_fastcgi will start another one to manage the load (process pools). in short, i think this will only complicate matters for no improvement. regards. -a -- =============================================================================== | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | A flower falls, even though we love it; | and a weed grows, even though we do not love it. | --Dogen ===============================================================================