On Tue, Mar 10, 2009 at 11:47 AM, Ryan Kroiss <kro...@wisc.edu> wrote: > I'm trying to develop a web site written in python that uses rpy2. The > site has some HTML input forms. The data from these forms is then > passed to R using rpy2. I've run into a problem with this though. If I > try to run more than one request at a time, I get a RRuntimeError that > concurrent access to R is not allowed. Does anyone know a way to work > around this? Can more than one instance of R be created? Is there a > way to somehow synchronize the access to R? Creating threads in the > python code wouldn't really work because separate requests would be > creating separate processes. Any help/suggestions would be appreciated.
If you're getting that error message, then it sounds like your web framework is creating multiple threads, rather than multiple processes... switching to multiple processes should fix the problem. I sent in a patch a while ago to make access to R threadsafe (not yet included in any released version of rpy2). Even with the patch, though, there would still only be one instance of R in your process, that different threads would take turns using; the only difference would be that the calls that are currently giving you an error would instead stop and wait for the other request to finish. -- Nathaniel ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ rpy-list mailing list rpy-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rpy-list