Fossil

Check-in [c40085c558]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Rename new setting to 'max-wthreads'. Make sure all new code relies upon USE_SYSTEM_SQLITE. Style cleanup.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | multi-thread
Files: files | file ages | folders
SHA1: c40085c55801ab44136e4e783ac3e217cd7739f7
User & Date: mistachkin 2014-09-12 21:43:23.037
Context
2014-09-26
14:04
merge trunk check-in: 9ba4ebaa66 user: jan.nijtmans tags: multi-thread
2014-09-12
21:43
Rename new setting to 'max-wthreads'. Make sure all new code relies upon USE_SYSTEM_SQLITE. Style cleanup. check-in: c40085c558 user: mistachkin tags: multi-thread
21:18
Merge trunk. Only enable max-worker-threads setting when fossil is compiled with --disable-internal-sqlite and SQLite is compiled with multi-thread support check-in: c5ec6abdba user: jan.nijtmans tags: multi-thread
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/db.c.
739
740
741
742
743
744
745

746

747
748
749
750
751
752
753
    db, "is_selected", 1, SQLITE_UTF8, 0, file_is_selected,0,0
  );
  sqlite3_create_function(
    db, "if_selected", 3, SQLITE_UTF8, 0, file_is_selected,0,0
  );
  if( g.fSqlTrace ) sqlite3_trace(db, db_sql_trace, 0);
  re_add_sql_func(db);

  sqlite3_limit(db, SQLITE_LIMIT_WORKER_THREADS, g.iMaxWorkerThreads);

  sqlite3_exec(db, "PRAGMA foreign_keys=OFF;", 0, 0, 0);
  return db;
}


/*
** Detaches the zLabel database.







>
|
>







739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
    db, "is_selected", 1, SQLITE_UTF8, 0, file_is_selected,0,0
  );
  sqlite3_create_function(
    db, "if_selected", 3, SQLITE_UTF8, 0, file_is_selected,0,0
  );
  if( g.fSqlTrace ) sqlite3_trace(db, db_sql_trace, 0);
  re_add_sql_func(db);
#if USE_SYSTEM_SQLITE+0==1
  sqlite3_limit(db, SQLITE_LIMIT_WORKER_THREADS, g.maxWorkerThreads);
#endif
  sqlite3_exec(db, "PRAGMA foreign_keys=OFF;", 0, 0, 0);
  return db;
}


/*
** Detaches the zLabel database.
1049
1050
1051
1052
1053
1054
1055

1056

1057
1058
1059
1060
1061
1062
1063
    }
  }
  g.zRepositoryName = mprintf("%s", zDbName);
  db_open_or_attach(g.zRepositoryName, "repository", 0);
  g.repositoryOpen = 1;
  /* Cache "allow-symlinks" option, because we'll need it on every stat call */
  g.allowSymlinks = db_get_boolean("allow-symlinks", 0);

  g.iMaxWorkerThreads = db_get_int("max-worker-threads", 0);

}

/*
** Flags for the db_find_and_open_repository() function.
*/
#if INTERFACE
#define OPEN_OK_NOT_FOUND    0x001      /* Do not error out if not found */







>
|
>







1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
    }
  }
  g.zRepositoryName = mprintf("%s", zDbName);
  db_open_or_attach(g.zRepositoryName, "repository", 0);
  g.repositoryOpen = 1;
  /* Cache "allow-symlinks" option, because we'll need it on every stat call */
  g.allowSymlinks = db_get_boolean("allow-symlinks", 0);
#if USE_SYSTEM_SQLITE+0==1
  g.maxWorkerThreads = db_get_int("max-wthreads", 0);
#endif
}

/*
** Flags for the db_find_and_open_repository() function.
*/
#if INTERFACE
#define OPEN_OK_NOT_FOUND    0x001      /* Do not error out if not found */
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
  { "keep-glob",        0,             40, 1, 0, ""                    },
  { "localauth",        0,              0, 0, 0, "off"                 },
  { "main-branch",      0,             40, 0, 0, "trunk"               },
  { "manifest",         0,              0, 1, 0, "off"                 },
  { "max-loadavg",      0,             25, 0, 0, "0.0"                 },
  { "max-upload",       0,             25, 0, 0, "250000"              },
#if USE_SYSTEM_SQLITE+0==1
  { "max-worker-threads",   0,         16, 0, 0, "0"                   },
#endif
  { "mtime-changes",    0,              0, 0, 0, "on"                  },
  { "pgp-command",      0,             40, 0, 0, "gpg --clearsign -o " },
  { "proxy",            0,             32, 0, 0, "off"                 },
  { "relative-paths",   0,              0, 0, 0, "on"                  },
  { "repo-cksum",       0,              0, 0, 0, "on"                  },
  { "self-register",    0,              0, 0, 0, "off"                 },







|







2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
  { "keep-glob",        0,             40, 1, 0, ""                    },
  { "localauth",        0,              0, 0, 0, "off"                 },
  { "main-branch",      0,             40, 0, 0, "trunk"               },
  { "manifest",         0,              0, 1, 0, "off"                 },
  { "max-loadavg",      0,             25, 0, 0, "0.0"                 },
  { "max-upload",       0,             25, 0, 0, "250000"              },
#if USE_SYSTEM_SQLITE+0==1
  { "max-wthreads",     0,             16, 0, 0, "0"                   },
#endif
  { "mtime-changes",    0,              0, 0, 0, "on"                  },
  { "pgp-command",      0,             40, 0, 0, "gpg --clearsign -o " },
  { "proxy",            0,             32, 0, 0, "off"                 },
  { "relative-paths",   0,              0, 0, 0, "on"                  },
  { "repo-cksum",       0,              0, 0, 0, "on"                  },
  { "self-register",    0,              0, 0, 0, "off"                 },
2361
2362
2363
2364
2365
2366
2367
2368
2369

2370
2371
2372
2373
2374
2375
2376
2377
**                     Only local settings of this value make a difference since
**                     when running as a web-server, Fossil does not open the
**                     global configuration database.
**
**    max-upload       A limit on the size of uplink HTTP requests.  The
**                     default is 250000 bytes.
**
**    max-worker-threads The maximum number of auxiliary worker threads that a
**                     single prepared statement may start. Only works when

**                     SQLite is compiled with multi-thread support.
**
**    mtime-changes    Use file modification times (mtimes) to detect when
**                     files have been modified.  (Default "on".)
**
**    pgp-command      Command used to clear-sign manifests at check-in.
**                     The default is "gpg --clearsign -o ".
**







|
|
>
|







2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
**                     Only local settings of this value make a difference since
**                     when running as a web-server, Fossil does not open the
**                     global configuration database.
**
**    max-upload       A limit on the size of uplink HTTP requests.  The
**                     default is 250000 bytes.
**
**    max-wthreads     The maximum number of auxiliary worker threads that a
**                     single prepared statement may start.  Only works when
**                     using the system SQLite library and when that library
**                     was compiled with support for threading.
**
**    mtime-changes    Use file modification times (mtimes) to detect when
**                     files have been modified.  (Default "on".)
**
**    pgp-command      Command used to clear-sign manifests at check-in.
**                     The default is "gpg --clearsign -o ".
**
Changes to src/main.c.
219
220
221
222
223
224
225
226




227
228
229
230
231
232
233
  const char *azAuxVal[MX_AUX];  /* Value of each aux() or option() value */
  const char **azAuxOpt[MX_AUX]; /* Options of each option() value */
  int anAuxCols[MX_AUX];         /* Number of columns for option() values */

  int allowSymlinks;             /* Cached "allow-symlinks" option */

  int mainTimerId;               /* Set to fossil_timer_start() */
  int iMaxWorkerThreads  ;       /* Store "max-worker-threads" setting */




#ifdef FOSSIL_ENABLE_JSON
  struct FossilJsonBits {
    int isJsonMode;            /* True if running in JSON mode, else
                                  false. This changes how errors are
                                  reported. In JSON mode we try to
                                  always output JSON-form error
                                  responses and always exit() with







|
>
>
>
>







219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
  const char *azAuxVal[MX_AUX];  /* Value of each aux() or option() value */
  const char **azAuxOpt[MX_AUX]; /* Options of each option() value */
  int anAuxCols[MX_AUX];         /* Number of columns for option() values */

  int allowSymlinks;             /* Cached "allow-symlinks" option */

  int mainTimerId;               /* Set to fossil_timer_start() */

#if USE_SYSTEM_SQLITE+0==1
  int maxWorkerThreads;          /* Cached "max-wthreads" option */
#endif

#ifdef FOSSIL_ENABLE_JSON
  struct FossilJsonBits {
    int isJsonMode;            /* True if running in JSON mode, else
                                  false. This changes how errors are
                                  reported. In JSON mode we try to
                                  always output JSON-form error
                                  responses and always exit() with
Changes to src/sqlcmd.c.
122
123
124
125
126
127
128

129

130
131
132
133
134
135
136
  sqlite3_create_function(db, "content", 1, SQLITE_UTF8, 0,
                          sqlcmd_content, 0, 0);
  sqlite3_create_function(db, "compress", 1, SQLITE_UTF8, 0,
                          sqlcmd_compress, 0, 0);
  sqlite3_create_function(db, "decompress", 1, SQLITE_UTF8, 0,
                          sqlcmd_decompress, 0, 0);
  re_add_sql_func(db);

  sqlite3_limit(db, SQLITE_LIMIT_WORKER_THREADS, g.iMaxWorkerThreads);

  g.repositoryOpen = 1;
  g.db = db;
  return SQLITE_OK;
}

/*
** COMMAND: sqlite3







>
|
>







122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
  sqlite3_create_function(db, "content", 1, SQLITE_UTF8, 0,
                          sqlcmd_content, 0, 0);
  sqlite3_create_function(db, "compress", 1, SQLITE_UTF8, 0,
                          sqlcmd_compress, 0, 0);
  sqlite3_create_function(db, "decompress", 1, SQLITE_UTF8, 0,
                          sqlcmd_decompress, 0, 0);
  re_add_sql_func(db);
#if USE_SYSTEM_SQLITE+0==1
  sqlite3_limit(db, SQLITE_LIMIT_WORKER_THREADS, g.maxWorkerThreads);
#endif
  g.repositoryOpen = 1;
  g.db = db;
  return SQLITE_OK;
}

/*
** COMMAND: sqlite3