[Rd] R as shared library

Jeffrey Horner jeff.horner at vanderbilt.edu
Thu Aug 26 00:15:59 CEST 2004

Warnes, Gregory R wrote:
> Jeff,
> Does apache use threads?  If it does, I would recommend *not* directly
> putting R into the apache server for the simple reason that R is not
> thread-safe.

Apache 1.3 doesn't use threads, and Apache 2.0 doesn't have to use 
threads. Both are still actively maintained by the Apache Foundation. 
The reason 1.3 is still around is because of its reliability and the 
fact that it's non-threaded. 2.0 introduced a handful of threaded 
plugins (called mpm's) for improving performance, but it's use has not 
caught on like some folks expected. The problem in my opinion? upgrading 
modules to be thread-safe *and* reliable.

I'm currently developing a version for Apache 2.0 since that's what we 
run (without threads). I plan on developing the same for 1.3.

> You might find it simpler (and cleaner) to use the RSOAP
> (http://rsoap.sf.net) interface to connect R with apache.  I originally
> created RSOAP to get allow me to connect the ZOPE web application system's
> web server to R.

Good point. However, I chose this route to 1) understand R and its 
internals, which is more complicated than I thought,  2) write an apache 
module, which I've always wanted to do, and 3) leverage Apache's robust 
  server technology. In my opinion, no other server software is as 
scalable and reliable as Apache. Plus, it has a module API to plugin 
other code, like an R interpreter.

Jeffrey Horner       Computer Systems Analyst         School of Medicine
615-322-8606         Department of Biostatistics   Vanderbilt University

More information about the R-devel mailing list