ara.t.howard / noaa.gov wrote:
> On Fri, 9 Dec 2005, James Britt wrote:
> 
>> I'm doing more work with fascgi and scgi, and I'm looking for some
>> clarification.  Are there configurations for either of these where 
>> multiple
>> application processes are sharing the same Ruby interpreter?
>>
>> If my own application code is not using threads, do I need to be 
>> concerned
>> with race conditions or data access conflicts?
> 
> 
> fastcgi is process based - you don't need to worry about any concurrent 
> access
> __other__ than between any two processes.   for instance, if your 
> application
> did something like
> 
>   log = open "log", "w"
> 
>   log << 42
> 
> then you could quite possibly have two processes writing to the log file 
> since
> apache can, depending on configuration, spawn a few processes to handle
> requests.  each request, however, defintely is running in one ruby
> interpreter.

Right.  There's no telling what other app might be trying to access the 
same external resource.

If I'm understanding this correctly, though, I need not be concerned 
with contention issues any more than I would with a plain CGI app; 
fastcgi and scgi are means of routing requests to persistent CGI 
processes, but a given process will not be handling more than one 
request at a time.

Thanks,



James


-- 

http://www.ruby-doc.org       - Ruby Help & Documentation
http://www.artima.com/rubycs/ - Ruby Code & Style: Writers wanted
http://www.rubystuff.com      - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com     - Playing with Better Toys
http://www.30secondrule.com   - Building Better Tools