On Tue, 17 Aug 2004, Carl Youngblood wrote: > True that in this particular case threads aren't necessary, but it > would still be nice to know if fcgi is thread-safe for other > purposes, such as that automatic process reloader that you and I were > talking about a while back. oh yeah - non-output related thread would indeed be nice. although i must add that even that code is just as easily implemented w/o threads: just check after each request is handled and exit if the source is updated (or on some other condition). in the end, the route i took was to test via a link page.cgi -> page.fcgi since this will be loaded everytime, and simply reload the fcgi when i was satisfied. ended up being just as easy. you still doing much fcgi work then? i haven't been able to do anything web related lately... ;-( -a > > On Tue, 17 Aug 2004 03:11:00 +0900, Ara.T.Howard <ahoward / noaa.gov> wrote: >> >> >> 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, "<br>\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 >> =============================================================================== >> >> > > > -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 ===============================================================================