You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2010/11/09 17:21:39 UTC

svn commit: r1033057 - in /subversion/branches/performance/subversion: libsvn_fs_util/caching.c svnserve/main.c

Author: stefan2
Date: Tue Nov  9 16:21:38 2010
New Revision: 1033057

URL: http://svn.apache.org/viewvc?rev=1033057&view=rev
Log:
Make the caches available if APR does not support multi-threading.

* subversion/libsvn_fs_util/caching.c
  (cache_settings): default to multi-threading only if APR supports it
* subversion/svnserve/main.c
  (main): enable multi-threading only if APR supports it (and required
  by command line parameters)

Modified:
    subversion/branches/performance/subversion/libsvn_fs_util/caching.c
    subversion/branches/performance/subversion/svnserve/main.c

Modified: subversion/branches/performance/subversion/libsvn_fs_util/caching.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_fs_util/caching.c?rev=1033057&r1=1033056&r2=1033057&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_fs_util/caching.c (original)
+++ subversion/branches/performance/subversion/libsvn_fs_util/caching.c Tue Nov  9 16:21:38 2010
@@ -37,7 +37,12 @@ static svn_fs_cache_config_t cache_setti
     16,          /* up to 16 files kept open */
     FALSE,       /* don't cache fulltexts */
     FALSE,       /* don't cache text deltas */
+
+#ifdef APR_HAS_THREADS
     FALSE        /* assume multi-threaded operation */
+#else
+    TRUE         /* single-threaded is the only supported mode of operation */
+#endif
   };
 
 /* Get the current FSFS cache configuration. */

Modified: subversion/branches/performance/subversion/svnserve/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/svnserve/main.c?rev=1033057&r1=1033056&r2=1033057&view=diff
==============================================================================
--- subversion/branches/performance/subversion/svnserve/main.c (original)
+++ subversion/branches/performance/subversion/svnserve/main.c Tue Nov  9 16:21:38 2010
@@ -852,7 +852,21 @@ int main(int argc, const char *argv[])
 
     settings.cache_fulltexts = TRUE;
     settings.cache_txdeltas = FALSE;
-    settings.single_threaded = handling_mode != connection_mode_thread;
+    settings.single_threaded = TRUE;
+
+    if (handling_mode == connection_mode_thread)
+      {
+#ifdef APR_HAS_THREADS
+        settings.single_threaded = FALSE;
+#else
+        /* No requests will be processed at all
+         * (see "switch (handling_mode)" code further down).
+         * But if they were, some other synchronization code
+         * would need to take care of securing integrity of
+         * APR-based structures. That would include our caches.
+         */
+#endif
+      }
 
     svn_fs_set_cache_config(&settings);
   }