You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2011/08/14 23:53:15 UTC

svn commit: r1157676 - in /tuscany/sca-cpp/trunk: ./ components/cache/ components/chat/ components/filedb/ components/log/ components/nosqldb/ components/queue/ components/sqldb/ components/webservice/ macos/ modules/http/ modules/js/ modules/server/ s...

Author: jsdelfino
Date: Sun Aug 14 21:53:15 2011
New Revision: 1157676

URL: http://svn.apache.org/viewvc?rev=1157676&view=rev
Log:
Switch from the HTTPD prefork MPM to the multi-threaded event MPM where possible. Fix multi-threading issues in the SpiderMonkey integration.

Modified:
    tuscany/sca-cpp/trunk/INSTALL
    tuscany/sca-cpp/trunk/components/cache/Makefile.am
    tuscany/sca-cpp/trunk/components/cache/memcached-ssl-test
    tuscany/sca-cpp/trunk/components/cache/server-test
    tuscany/sca-cpp/trunk/components/chat/server-test
    tuscany/sca-cpp/trunk/components/filedb/filedb.hpp
    tuscany/sca-cpp/trunk/components/filedb/server-test
    tuscany/sca-cpp/trunk/components/log/server-test
    tuscany/sca-cpp/trunk/components/nosqldb/server-test
    tuscany/sca-cpp/trunk/components/queue/server-test
    tuscany/sca-cpp/trunk/components/sqldb/server-test
    tuscany/sca-cpp/trunk/components/sqldb/standby-test
    tuscany/sca-cpp/trunk/components/webservice/server-test
    tuscany/sca-cpp/trunk/macos/macos-install
    tuscany/sca-cpp/trunk/modules/http/http-test
    tuscany/sca-cpp/trunk/modules/http/httpd-test
    tuscany/sca-cpp/trunk/modules/http/proxy-test
    tuscany/sca-cpp/trunk/modules/js/eval.hpp
    tuscany/sca-cpp/trunk/modules/server/httpd-test
    tuscany/sca-cpp/trunk/modules/server/server-test
    tuscany/sca-cpp/trunk/modules/server/wiring-test
    tuscany/sca-cpp/trunk/samples/store-cpp/start
    tuscany/sca-cpp/trunk/samples/store-nosql/start
    tuscany/sca-cpp/trunk/samples/store-scheme/start
    tuscany/sca-cpp/trunk/samples/store-sql/start
    tuscany/sca-cpp/trunk/ubuntu/ubuntu-install
    tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all

Modified: tuscany/sca-cpp/trunk/INSTALL
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/INSTALL?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/INSTALL (original)
+++ tuscany/sca-cpp/trunk/INSTALL Sun Aug 14 21:53:15 2011
@@ -106,8 +106,9 @@ curl-7-19-5
 libcurl4-openssl-7.19.5
 
 JSON:
-Mozilla SpiderMonkey libmozjs 1.8.5
+Mozilla SpiderMonkey libmozjs 1.8.5 and
 (https://developer.mozilla.org/en/SpiderMonkey)
+built with Mozilla nspr-4.8.8
 
 Key/value store:
 tinycdb-0.77 (http://www.corpit.ru/mjt/tinycdb.html)

Modified: tuscany/sca-cpp/trunk/components/cache/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/cache/Makefile.am?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/cache/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/components/cache/Makefile.am Sun Aug 14 21:53:15 2011
@@ -50,5 +50,4 @@ client_test_LDFLAGS = -lxml2 -lcurl -lmo
 
 dist_noinst_SCRIPTS = memcached-test memcached-ssl-test server-test
 noinst_PROGRAMS = memcache-test client-test
-#TESTS = memcached-test memcached-ssl-test server-test
-TESTS = memcached-test server-test
+TESTS = memcached-test memcached-ssl-test server-test

Modified: tuscany/sca-cpp/trunk/components/cache/memcached-ssl-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/cache/memcached-ssl-test?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/cache/memcached-ssl-test (original)
+++ tuscany/sca-cpp/trunk/components/cache/memcached-ssl-test Sun Aug 14 21:53:15 2011
@@ -35,6 +35,7 @@ tar -C tmp/ssl -c `../../modules/http/ss
 ../../modules/http/httpd-start tmp/tunnel
 
 ../../modules/http/httpd-conf tmp/server localhost 8090 htdocs
+../../modules/http/httpd-event-conf tmp/server
 tar -C tmp/ssl -c `../../modules/http/ssl-cert-find tmp/ssl` | tar -C tmp/server -x
 ../../modules/http/httpd-ssl-conf tmp/server 8453
 ../../modules/http/cert-auth-conf tmp/server

Modified: tuscany/sca-cpp/trunk/components/cache/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/cache/server-test?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/cache/server-test (original)
+++ tuscany/sca-cpp/trunk/components/cache/server-test Sun Aug 14 21:53:15 2011
@@ -19,6 +19,7 @@
 
 # Setup
 ../../modules/http/httpd-conf tmp localhost 8090 ../../modules/http/htdocs
+../../modules/http/httpd-event-conf tmp
 ../../modules/server/server-conf tmp
 ../../modules/server/scheme-conf tmp
 cat >>tmp/conf/httpd.conf <<EOF

Modified: tuscany/sca-cpp/trunk/components/chat/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/chat/server-test?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/chat/server-test (original)
+++ tuscany/sca-cpp/trunk/components/chat/server-test Sun Aug 14 21:53:15 2011
@@ -19,6 +19,7 @@
 
 # Setup
 ../../modules/http/httpd-conf tmp localhost 8090 ../../modules/http/htdocs
+../../modules/http/httpd-event-conf tmp
 ../../modules/server/server-conf tmp
 ../../modules/server/scheme-conf tmp
 cat >>tmp/conf/httpd.conf <<EOF

Modified: tuscany/sca-cpp/trunk/components/filedb/filedb.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/filedb/filedb.hpp?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/filedb/filedb.hpp (original)
+++ tuscany/sca-cpp/trunk/components/filedb/filedb.hpp Sun Aug 14 21:53:15 2011
@@ -44,16 +44,16 @@ namespace filedb {
  */
 class FileDB {
 public:
-    FileDB() : owner(false), jscx(*jscontext("")) {
+    FileDB() : owner(false) {
         debug("filedb::filedb");
     }
 
-    FileDB(const string& name, const string& format) : owner(true), name(name), format(format), jscx(*jscontext(format)) {
+    FileDB(const string& name, const string& format) : owner(true), name(name), format(format) {
         debug(name, "filedb::filedb::name");
         debug(format, "filedb::filedb::format");
     }
 
-    FileDB(const FileDB& c) : owner(false), name(c.name), format(c.format), jscx(c.jscx) {
+    FileDB(const FileDB& c) : owner(false), name(c.name), format(c.format) {
         debug("filedb::filedb::copy");
     }
 
@@ -65,16 +65,9 @@ private:
     bool owner;
     string name;
     string format;
-    js::JSContext& jscx;
 
-    js::JSContext* jscontext(const string& format) {
-        if (format != "json")
-            return NULL;
-        return new (gc_new<js::JSContext>()) js::JSContext();
-    }
-
-    friend const failable<bool> write(const value& v, ostream& os, const string& format, FileDB& db);
-    friend const failable<value> read(istream& is, const string& format, FileDB& db);
+    friend const failable<bool> write(const value& v, ostream& os, const string& format);
+    friend const failable<value> read(istream& is, const string& format);
     friend const failable<bool> post(const value& key, const value& val, FileDB& db);
     friend const failable<bool> put(const value& key, const value& val, FileDB& db);
     friend const failable<value> get(const value& key, FileDB& db);
@@ -111,7 +104,7 @@ const failable<bool> mkdirs(const list<v
 /**
  * Write a value to a database file.
  */
-const failable<bool> write(const value& v, ostream& os, const string& format, FileDB& db) {
+const failable<bool> write(const value& v, ostream& os, const string& format) {
     if (format == "scheme") {
         const string vs(scheme::writeValue(v));
         os << vs;
@@ -125,7 +118,8 @@ const failable<bool> write(const value& 
         return true;
     }
     if (format == "json") {
-        failable<list<string> > s = json::writeJSON(valuesToElements(v), db.jscx);
+        js::JSContext jscx;
+        failable<list<string> > s = json::writeJSON(valuesToElements(v), jscx);
         if (!hasContent(s))
             return mkfailure<bool>(reason(s));
         write(content(s), os);
@@ -137,7 +131,7 @@ const failable<bool> write(const value& 
 /**
  * Read a value from a database file.
  */
-const failable<value> read(istream& is, const string& format, FileDB& db) {
+const failable<value> read(istream& is, const string& format) {
     if (format == "scheme") {
         return scheme::readValue(is);
     }
@@ -146,7 +140,8 @@ const failable<value> read(istream& is, 
         return v;
     }
     if (format == "json") {
-        const failable<list<value> > fv = json::readJSON(streamList(is), db.jscx);
+        js::JSContext jscx;
+        const failable<list<value> > fv = json::readJSON(streamList(is), jscx);
         if (!hasContent(fv))
             return mkfailure<value>(reason(fv));
         const value v = elementsToValues(content(fv));
@@ -170,7 +165,7 @@ const failable<bool> post(const value& k
     ofstream os(fn);
     if (os.fail())
         return mkfailure<bool>("Couldn't post file database entry.");
-    const failable<bool> r = write(val, os, db.format, db);
+    const failable<bool> r = write(val, os, db.format);
 
     debug(r, "filedb::post::result");
     return r;
@@ -191,7 +186,7 @@ const failable<bool> put(const value& ke
     ofstream os(fn);
     if (os.fail())
         return mkfailure<bool>("Couldn't put file database entry.");
-    const failable<bool> r = write(val, os, db.format, db);
+    const failable<bool> r = write(val, os, db.format);
 
     debug(r, "filedb::put::result");
     return r;
@@ -209,7 +204,7 @@ const failable<value> get(const value& k
     ifstream is(fn);
     if (is.fail())
         return mkfailure<value>("Couldn't get file database entry.");
-    const failable<value> val = read(is, db.format, db);
+    const failable<value> val = read(is, db.format);
 
     debug(val, "filedb::get::result");
     return val;

Modified: tuscany/sca-cpp/trunk/components/filedb/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/filedb/server-test?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/filedb/server-test (original)
+++ tuscany/sca-cpp/trunk/components/filedb/server-test Sun Aug 14 21:53:15 2011
@@ -19,6 +19,7 @@
 
 # Setup
 ../../modules/http/httpd-conf tmp localhost 8090 ../../modules/http/htdocs
+../../modules/http/httpd-event-conf tmp
 ../../modules/server/server-conf tmp
 ../../modules/server/scheme-conf tmp
 cat >>tmp/conf/httpd.conf <<EOF

Modified: tuscany/sca-cpp/trunk/components/log/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/log/server-test?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/log/server-test (original)
+++ tuscany/sca-cpp/trunk/components/log/server-test Sun Aug 14 21:53:15 2011
@@ -19,6 +19,7 @@
 
 # Setup
 ../../modules/http/httpd-conf tmp localhost 8090 ../../modules/http/htdocs
+../../modules/http/httpd-event-conf tmp
 ../../modules/server/server-conf tmp
 ../../modules/server/scheme-conf tmp
 cat >>tmp/conf/httpd.conf <<EOF

Modified: tuscany/sca-cpp/trunk/components/nosqldb/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/nosqldb/server-test?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/nosqldb/server-test (original)
+++ tuscany/sca-cpp/trunk/components/nosqldb/server-test Sun Aug 14 21:53:15 2011
@@ -19,6 +19,7 @@
 
 # Setup
 ../../modules/http/httpd-conf tmp localhost 8090 ../../modules/http/htdocs
+../../modules/http/httpd-event-conf tmp
 ../../modules/server/server-conf tmp
 ../../modules/server/scheme-conf tmp
 cat >>tmp/conf/httpd.conf <<EOF

Modified: tuscany/sca-cpp/trunk/components/queue/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/queue/server-test?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/queue/server-test (original)
+++ tuscany/sca-cpp/trunk/components/queue/server-test Sun Aug 14 21:53:15 2011
@@ -19,6 +19,7 @@
 
 # Setup
 ../../modules/http/httpd-conf tmp localhost 8090 ../../modules/http/htdocs
+../../modules/http/httpd-event-conf tmp
 ../../modules/server/server-conf tmp
 ../../modules/server/scheme-conf tmp
 cat >>tmp/conf/httpd.conf <<EOF

Modified: tuscany/sca-cpp/trunk/components/sqldb/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/sqldb/server-test?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/sqldb/server-test (original)
+++ tuscany/sca-cpp/trunk/components/sqldb/server-test Sun Aug 14 21:53:15 2011
@@ -19,6 +19,7 @@
 
 # Setup
 ../../modules/http/httpd-conf tmp localhost 8090 ../../modules/http/htdocs
+../../modules/http/httpd-event-conf tmp
 ./pgsql-conf tmp
 ./pgsql-start tmp
 ./pgsql "drop table test;" 1>/dev/null 2>&1

Modified: tuscany/sca-cpp/trunk/components/sqldb/standby-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/sqldb/standby-test?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/sqldb/standby-test (original)
+++ tuscany/sca-cpp/trunk/components/sqldb/standby-test Sun Aug 14 21:53:15 2011
@@ -19,6 +19,7 @@
 
 # Setup
 ../../modules/http/httpd-conf tmp/master localhost 8090 tmp/master/htdocs
+../../modules/http/httpd-event-conf tmp
 ./pgsql-conf tmp/master 5432
 ./pgsql-start tmp/master
 ./pgsql localhost 5432 "drop table test;" 1>/dev/null 2>&1

Modified: tuscany/sca-cpp/trunk/components/webservice/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/webservice/server-test?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/webservice/server-test (original)
+++ tuscany/sca-cpp/trunk/components/webservice/server-test Sun Aug 14 21:53:15 2011
@@ -19,6 +19,7 @@
 
 # Setup
 ../../modules/http/httpd-conf tmp localhost 8090 ../../modules/http/htdocs
+../../modules/http/httpd-event-conf tmp
 ../../modules/server/server-conf tmp
 ../../modules/server/scheme-conf tmp
 ./axis2-conf tmp

Modified: tuscany/sca-cpp/trunk/macos/macos-install
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/macos/macos-install?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/macos/macos-install (original)
+++ tuscany/sca-cpp/trunk/macos/macos-install Sun Aug 14 21:53:15 2011
@@ -149,11 +149,23 @@ if [ "$?" != "0" ]; then
 fi
 cd $build
 
+# Build Mozilla Portable Runtime
+curl -OL http://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.8.8/src/nspr-4.8.8.tar.gz
+tar xzf nspr-4.8.8.tar.gz
+cd nspr-4.8.8/mozilla/nsprpub
+./configure --prefix=$build/nspr-4.8.8-bin --enable-64bit
+make
+make install
+if [ "$?" != "0" ]; then
+    exit $?
+fi
+cd $build
+
 # Build SpiderMonkey
 curl -OL http://ftp.mozilla.org/pub/mozilla.org/js/js-1.8.5.tar.gz
 tar xzf js185-1.0.0.tar.gz
 cd js-1.8.5/js/src
-./configure --prefix=$build/js-1.8.5-bin
+./configure --prefix=$build/js-1.8.5-bin --enable-threadsafe --with-system-nspr --with-nspr-prefix=$build/nspr-4.8.8-bin
 make
 make install
 ln -s $build/js-1.8.5-bin/lib/libmozjs185.dylib $build/js-1.8.5-bin/lib/libmozjs.dylib
@@ -268,7 +280,7 @@ cd $build
 git clone git://git.apache.org/tuscany-sca-cpp.git
 cd tuscany-sca-cpp
 ./bootstrap
-./configure CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++ --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.19.5-bin --with-apr=$build/apr-1.4.x-bin --with-httpd=$build/httpd-2.3.10-bin --with-memcached=$build/memcached-1.4.5-bin --with-tinycdb=$build/tinycdb-bin --with-js-include=$build/tracemonkey-bin/include/js --with-js-lib=$build/tracemonkey-bin/lib --with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python --with-libxml2=$build/libxml2-2.7.7-bin --enable-chat --with-libstrophe=$build/libstrophe-bin --enable-openid --with-mod-auth-openid=$build/mod-auth-openid-bin --enable-oauth --with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security --with-mod-security=$build/modsecurity-apache-2.6.0-bin
+./configure CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++ --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.19.5-bin --with-apr=$build/apr-1.4.x-bin --with-httpd=$build/httpd-2.3.10-bin --with-memcached=$build/memcached-1.4.5-bin --with-tinycdb=$build/tinycdb-bin --with-js-include=$build/js-1.8.5-bin/include/js --with-js-lib=$build/js-1.8.5-bin/lib --with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python --with-libxml2=$build/libxml2-2.7.7-bin --enable-chat --with-libstrophe=$build/libstrophe-bin --enable-openid --with-mod-auth-openid=$build/mod-auth-openid-bin --enable-oauth --with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security --with-mod-security=$build/modsecurity-apache-2.6.0-bin
 make
 make install
 if [ "$?" != "0" ]; then
@@ -277,8 +289,8 @@ fi
 cd $build
 
 # Create src archive
-tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin autoconf-2.13 autoconf-2.13-bin autoconf-2.13.tar.gz curl-7.19.5 curl-7.19.5-bin curl-7.19.5.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.10 httpd-2.3.10-alpha.tar.gz httpd-2.3.10-bin libcloud-0.4.2-bin libevent-2.0.12-stable libevent-2.0.12-stable-bin libevent-2.0.12-stable.tar.gz liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.5 memcached-1.4.5-bin memcached-1.4.5.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.0 modsecurity-apache-2.6.0-bin modsecurity-apache_2.6.0.tar.gz modsecurity-crs_2.2.0 modsecurity-crs_2.2.0.tar.gz nuvem pcre-8.12 pcre-8.12-bin pcre-8.12.zip pkg-config-0.25 pkg-config-0.25-bin pkg-config-0.25.tar.gz tidy tinycdb tinycdb-bin tracemonke
 y-bin tracemonkey-e4364736e170 tracemonkey-e4364736e170.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin
+tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin autoconf-2.13 autoconf-2.13-bin autoconf-2.13.tar.gz curl-7.19.5 curl-7.19.5-bin curl-7.19.5.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.10 httpd-2.3.10-alpha.tar.gz httpd-2.3.10-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin libevent-2.0.12-stable libevent-2.0.12-stable-bin libevent-2.0.12-stable.tar.gz liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.5 memcached-1.4.5-bin memcached-1.4.5.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.0 modsecurity-apache-2.6.0-bin modsecurity-apache_2.6.0.tar.gz modsecurity-crs_2.2.0 modsecurity-crs_2.2.0.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem pcre-8.12 pcre-8.12-bin pcre-8.12.zip pkg-confi
 g-0.25 pkg-config-0.25-bin pkg-config-0.25.tar.gz tidy tinycdb tinycdb-bin tuscany-sca-cpp tuscany-sca-cpp-bin
 
 # Create bin archive
-tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.19.5-bin expat-2.0.1-bin htmltidy-bin httpd-2.3.10-bin libcloud-0.4.2-bin libevent-2.0.12-stable-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.5-bin mod-auth-openid-bin modsecurity-apache-2.6.0-bin nuvem/nuvem-parallel pcre-8.12-bin tinycdb-bin tracemonkey-bin tuscany-sca-cpp tuscany-sca-cpp-bin
+tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.19.5-bin expat-2.0.1-bin htmltidy-bin httpd-2.3.10-bin js-1.8.5-bin libcloud-0.4.2-bin libevent-2.0.12-stable-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.5-bin mod-auth-openid-bin modsecurity-apache-2.6.0-bin nspr-4.8.8-bin nuvem/nuvem-parallel pcre-8.12-bin tinycdb-bin tuscany-sca-cpp tuscany-sca-cpp-bin
 

Modified: tuscany/sca-cpp/trunk/modules/http/http-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/http-test?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/http-test (original)
+++ tuscany/sca-cpp/trunk/modules/http/http-test Sun Aug 14 21:53:15 2011
@@ -19,6 +19,7 @@
 
 # Setup
 ./httpd-conf tmp localhost 8090 htdocs
+./httpd-event-conf tmp
 ./httpd-start tmp
 sleep 2
 

Modified: tuscany/sca-cpp/trunk/modules/http/httpd-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/httpd-test?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/httpd-test (original)
+++ tuscany/sca-cpp/trunk/modules/http/httpd-test Sun Aug 14 21:53:15 2011
@@ -23,6 +23,7 @@ curl_prefix=`cat $here/../http/curl.pref
 
 # Setup
 ./httpd-conf tmp localhost 8090 htdocs
+./httpd-event-conf tmp
 ./httpd-start tmp
 sleep 2
 

Modified: tuscany/sca-cpp/trunk/modules/http/proxy-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/proxy-test?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/proxy-test (original)
+++ tuscany/sca-cpp/trunk/modules/http/proxy-test Sun Aug 14 21:53:15 2011
@@ -19,8 +19,10 @@
 
 # Setup
 ./httpd-conf tmp localhost 8091/8090 htdocs
+./httpd-event-conf tmp
 ./httpd-start tmp
 ./httpd-conf tmp/proxy localhost 8090 tmp/proxy/htdocs
+./httpd-event-conf tmp/proxy
 ./proxy-conf tmp/proxy
 ./proxy-member-conf tmp/proxy localhost 8091
 ./httpd-start tmp/proxy

Modified: tuscany/sca-cpp/trunk/modules/js/eval.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/js/eval.hpp?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/js/eval.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/js/eval.hpp Sun Aug 14 21:53:15 2011
@@ -103,14 +103,23 @@ JSClass jsGlobalClass = { "global", JSCL
     JSCLASS_NO_OPTIONAL_MEMBERS };
 
 /**
- * Represents a JavaScript context. Create one per thread.
+ * Represents a JavaScript context. Maintains one context per thread.
  */
+#ifdef WANT_THREADS
+__thread
+#endif
+::JSContext* jsContext = NULL;
+
 class JSContext {
 public:
     JSContext() {
-        // Create JS context
+        // Create JS context if necessary
         debug("js::jscontext");
-        cx = JS_NewContext(jsRuntime, 8192);
+        if (jsContext != NULL) {
+            cx = jsContext;
+            return;
+        }
+        cx = JS_NewContext(jsRuntime, 32768);
         if(cx == NULL)
             return;
         JS_SetOptions(cx, JSOPTION_VAROBJFIX | JSOPTION_JIT | JSOPTION_METHODJIT);
@@ -129,10 +138,13 @@ public:
             cleanup();
             return;
         }
+        jsContext = cx;
     }
 
     ~JSContext() {
         debug("js::~jscontext");
+        if (cx != NULL)
+            JS_GC(cx);
         cleanup();
     }
 
@@ -147,7 +159,8 @@ public:
 private:
     bool cleanup() {
         if(cx != NULL) {
-            JS_DestroyContext(cx);
+            if (cx != jsContext)
+                JS_DestroyContext(cx);
             cx = NULL;
         }
         return true;

Modified: tuscany/sca-cpp/trunk/modules/server/httpd-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/server/httpd-test?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/httpd-test (original)
+++ tuscany/sca-cpp/trunk/modules/server/httpd-test Sun Aug 14 21:53:15 2011
@@ -23,6 +23,7 @@ curl_prefix=`cat $here/../http/curl.pref
 
 # Setup
 ../http/httpd-conf tmp localhost 8090 htdocs
+../http/httpd-event-conf tmp
 ./server-conf tmp
 ./scheme-conf tmp
 cat >>tmp/conf/httpd.conf <<EOF

Modified: tuscany/sca-cpp/trunk/modules/server/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/server/server-test?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/server-test (original)
+++ tuscany/sca-cpp/trunk/modules/server/server-test Sun Aug 14 21:53:15 2011
@@ -19,6 +19,7 @@
 
 # Setup
 ../http/httpd-conf tmp localhost 8090 htdocs
+../http/httpd-event-conf tmp
 ./server-conf tmp
 ./scheme-conf tmp
 cat >>tmp/conf/httpd.conf <<EOF

Modified: tuscany/sca-cpp/trunk/modules/server/wiring-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/server/wiring-test?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/wiring-test (original)
+++ tuscany/sca-cpp/trunk/modules/server/wiring-test Sun Aug 14 21:53:15 2011
@@ -23,6 +23,7 @@ curl_prefix=`cat $here/../http/curl.pref
 
 # Setup
 ../http/httpd-conf tmp localhost 8090 htdocs
+../http/httpd-event-conf tmp
 ./server-conf tmp
 ./scheme-conf tmp
 cat >>tmp/conf/httpd.conf <<EOF

Modified: tuscany/sca-cpp/trunk/samples/store-cpp/start
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cpp/start?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cpp/start (original)
+++ tuscany/sca-cpp/trunk/samples/store-cpp/start Sun Aug 14 21:53:15 2011
@@ -18,6 +18,7 @@
 #  under the License.
 
 ../../modules/http/httpd-conf tmp localhost 8090 htdocs
+../../modules/http/httpd-event-conf tmp
 ../../modules/server/server-conf tmp
 ../../modules/server/cpp-conf tmp
 cat >>tmp/conf/httpd.conf <<EOF

Modified: tuscany/sca-cpp/trunk/samples/store-nosql/start
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-nosql/start?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-nosql/start (original)
+++ tuscany/sca-cpp/trunk/samples/store-nosql/start Sun Aug 14 21:53:15 2011
@@ -18,6 +18,7 @@
 #  under the License.
 
 ../../modules/http/httpd-conf tmp localhost 8090 htdocs
+../../modules/http/httpd-event-conf tmp
 ../../modules/server/server-conf tmp
 ../../modules/server/scheme-conf tmp
 cat >>tmp/conf/httpd.conf <<EOF

Modified: tuscany/sca-cpp/trunk/samples/store-scheme/start
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-scheme/start?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-scheme/start (original)
+++ tuscany/sca-cpp/trunk/samples/store-scheme/start Sun Aug 14 21:53:15 2011
@@ -18,6 +18,7 @@
 #  under the License.
 
 ../../modules/http/httpd-conf tmp localhost 8090 htdocs
+../../modules/http/httpd-event-conf tmp
 ../../modules/server/server-conf tmp
 ../../modules/server/scheme-conf tmp
 cat >>tmp/conf/httpd.conf <<EOF

Modified: tuscany/sca-cpp/trunk/samples/store-sql/start
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-sql/start?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-sql/start (original)
+++ tuscany/sca-cpp/trunk/samples/store-sql/start Sun Aug 14 21:53:15 2011
@@ -18,6 +18,7 @@
 #  under the License.
 
 ../../modules/http/httpd-conf tmp localhost 8090 htdocs
+../../modules/http/httpd-event-conf tmp
 ../../modules/server/server-conf tmp
 ../../modules/server/scheme-conf tmp
 cat >>tmp/conf/httpd.conf <<EOF

Modified: tuscany/sca-cpp/trunk/ubuntu/ubuntu-install
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/ubuntu/ubuntu-install?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/ubuntu/ubuntu-install (original)
+++ tuscany/sca-cpp/trunk/ubuntu/ubuntu-install Sun Aug 14 21:53:15 2011
@@ -121,11 +121,23 @@ if [ "$?" != "0" ]; then
 fi
 cd $build
 
+# Build Mozilla Portable Runtime
+wget http://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.8.8/src/nspr-4.8.8.tar.gz
+tar xzf nspr-4.8.8.tar.gz
+cd nspr-4.8.8/mozilla/nsprpub
+./configure --prefix=$build/nspr-4.8.8-bin --enable-64bit
+make
+make install
+if [ "$?" != "0" ]; then
+    exit $?
+fi
+cd $build
+
 # Build SpiderMonkey
 wget http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
 tar xzf js185-1.0.0.tar.gz
 cd js-1.8.5/js/src
-./configure --prefix=$build/js-1.8.5-bin
+./configure --prefix=$build/js-1.8.5-bin --enable-threadsafe --with-system-nspr --with-nspr-prefix=$build/nspr-4.8.8-bin
 make
 make install
 ln -s $build/js-1.8.5-bin/lib/libmozjs185.so $build/js-1.8.5-bin/lib/libmozjs.so
@@ -294,8 +306,8 @@ fi
 cd $build
 
 # Create src archive
-tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin curl-7.19.5 curl-7.19.5-bin curl-7.19.5.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.10 httpd-2.3.10-alpha.tar.gz httpd-2.3.10-bin libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.5 memcached-1.4.5-bin memcached-1.4.5.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.0 modsecurity-apache-2.6.0-bin modsecurity-apache_2.6.0.tar.gz modsecurity-crs_2.2.0 modsecurity-crs_2.2.0.tar.gz nuvem scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin
+tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin curl-7.19.5 curl-7.19.5-bin curl-7.19.5.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.10 httpd-2.3.10-alpha.tar.gz httpd-2.3.10-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.5 memcached-1.4.5-bin memcached-1.4.5.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.0 modsecurity-apache-2.6.0-bin modsecurity-apache_2.6.0.tar.gz modsecurity-crs_2.2.0 modsecurity-crs_2.2.0.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-
 sca-cpp-bin
 
 # Create bin archive
-tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.19.5-bin expat-2.0.1-bin htmltidy-bin httpd-2.3.10-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.5-bin mod-auth-openid-bin modsecurity-apache-2.6.0-bin nuvem/nuvem-parallel scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin js-1.8.5-bin tuscany-sca-cpp tuscany-sca-cpp-bin
+tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.19.5-bin expat-2.0.1-bin htmltidy-bin httpd-2.3.10-bin js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.5-bin mod-auth-openid-bin modsecurity-apache-2.6.0-bin nspr-4.8.8-bin nuvem/nuvem-parallel scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin
 

Modified: tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all?rev=1157676&r1=1157675&r2=1157676&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all (original)
+++ tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all Sun Aug 14 21:53:15 2011
@@ -121,11 +121,23 @@ if [ "$?" != "0" ]; then
 fi
 cd $build
 
+# Build Mozilla Portable Runtime
+wget http://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.8.8/src/nspr-4.8.8.tar.gz
+tar xzf nspr-4.8.8.tar.gz
+cd nspr-4.8.8/mozilla/nsprpub
+./configure --prefix=$build/nspr-4.8.8-bin --enable-64bit
+make
+make install
+if [ "$?" != "0" ]; then
+    exit $?
+fi
+cd $build
+
 # Build SpiderMonkey
 wget http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
 tar xzf js185-1.0.0.tar.gz
 cd js-1.8.5/js/src
-./configure --prefix=$build/js-1.8.5-bin
+./configure --prefix=$build/js-1.8.5-bin --enable-threadsafe --with-system-nspr --with-nspr-prefix=$build/nspr-4.8.8-bin
 make
 make install
 ln -s $build/js-1.8.5-bin/lib/libmozjs185.so $build/js-1.8.5-bin/lib/libmozjs.so
@@ -279,7 +291,7 @@ fi
 wget ftp://ftp9.us.postgresql.org/pub/mirrors/postgresql/source/v9.0.3/postgresql-9.0.3.tar.gz
 tar xzf postgresql-9.0.3.tar.gz
 cd postgresql-9.0.3
-./configure --prefix=$build/postgresql-9.0.3-bin
+./configure --prefix=$build/postgresql-9.0.3-bin --enable-thread-safety
 make
 make install
 if [ "$?" != "0" ]; then
@@ -364,8 +376,8 @@ fi
 cd $build
 
 # Create src archive
-tar czf tuscany-sca-cpp-all-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin axis2c-1.6.0-bin axis2c-src-1.6.0 axis2c-src-1.6.0.tar.gz curl-7.19.5 curl-7.19.5-bin curl-7.19.5.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz google_appengine google_appengine_1.4.0.zip htmltidy-bin httpd-2.3.10 httpd-2.3.10-alpha.tar.gz httpd-2.3.10-bin libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.5 memcached-1.4.5-bin memcached-1.4.5.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.0 modsecurity-apache-2.6.0-bin modsecurity-apache_2.6.0.tar.gz modsecurity-crs_2.2.0 modsecurity-crs_2.2.0.tar.gz nuvem postgresql-9.0.3 postgresql-9.0.3-bin postgresql-9.0.3.tar.gz qpidc-0.6 qpidc-0.6-bin qpid-cpp-0.6.tar.gz scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 
 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6 vysper-0.6-bin.tar.gz
+tar czf tuscany-sca-cpp-all-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin axis2c-1.6.0-bin axis2c-src-1.6.0 axis2c-src-1.6.0.tar.gz curl-7.19.5 curl-7.19.5-bin curl-7.19.5.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz google_appengine google_appengine_1.4.0.zip htmltidy-bin httpd-2.3.10 httpd-2.3.10-alpha.tar.gz httpd-2.3.10-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.5 memcached-1.4.5-bin memcached-1.4.5.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.0 modsecurity-apache-2.6.0-bin modsecurity-apache_2.6.0.tar.gz modsecurity-crs_2.2.0 modsecurity-crs_2.2.0.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem postgresql-9.0.3 postgresql-9.0.3-bin postgresql-9.0.3.tar.gz qpidc-0.6 qp
 idc-0.6-bin qpid-cpp-0.6.tar.gz scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6 vysper-0.6-bin.tar.gz
 
 # Create bin archive
-tar czf tuscany-sca-cpp-all-1.0.tar.gz apr-1.4.x-bin axis2c-1.6.0-bin curl-7.19.5-bin expat-2.0.1-bin google_appengine htmltidy-bin httpd-2.3.10-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.5-bin mod-auth-openid-bin modsecurity-apache-2.6.0-bin nuvem/nuvem-parallel postgresql-9.0.3-bin qpidc-0.6-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin js-1.8.5-bin tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6
+tar czf tuscany-sca-cpp-all-1.0.tar.gz apr-1.4.x-bin axis2c-1.6.0-bin curl-7.19.5-bin expat-2.0.1-bin google_appengine htmltidy-bin httpd-2.3.10-bin js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.5-bin mod-auth-openid-bin modsecurity-apache-2.6.0-bin nspr-4.8.8-bin nuvem/nuvem-parallel postgresql-9.0.3-bin qpidc-0.6-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6