/ Check-in [2ab4b5ad]
Login

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

Overview
Comment:Fix the speedtest1.c test program to set the worker thread count using the threads pragma.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | threads
Files: files | file ages | folders
SHA1: 2ab4b5adc60b52bf2d2b79968d226b8dd7d2ab3b
User & Date: drh 2014-08-29 18:06:33
Context
2014-08-29
19:06
Disable worker threads when SQLITE_THREADSAFE=0. Set the default compile-time maximum number of worker threads to 8 and honor the SQLITE_DEFAULT_WORKER_THREADS compile-time constant (which defaults to 0). Closed-Leaf check-in: 33fa0410 user: drh tags: threads
18:06
Fix the speedtest1.c test program to set the worker thread count using the threads pragma. check-in: 2ab4b5ad user: drh tags: threads
16:20
Add SQLITE_LIMIT_WORKER_THREADS for controlling the maximum number of worker threads. check-in: 1b598c68 user: drh tags: threads
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to test/speedtest1.c.

  1274   1274     if( nScratch>0 && szScratch>0 ){
  1275   1275       pScratch = malloc( nScratch*(sqlite3_int64)szScratch );
  1276   1276       if( pScratch==0 ) fatal_error("cannot allocate %lld-byte scratch\n",
  1277   1277                                    nScratch*(sqlite3_int64)szScratch);
  1278   1278       rc = sqlite3_config(SQLITE_CONFIG_SCRATCH, pScratch, szScratch, nScratch);
  1279   1279       if( rc ) fatal_error("scratch configuration failed: %d\n", rc);
  1280   1280     }
  1281         -#ifdef SQLITE_CONFIG_WORKER_THREADS
  1282         -  if( nThread>0 ){
  1283         -    sqlite3_config(SQLITE_CONFIG_WORKER_THREADS, nThread);
  1284         -  }
  1285         -#endif
  1286   1281     if( nLook>0 ){
  1287   1282       sqlite3_config(SQLITE_CONFIG_LOOKASIDE, 0, 0);
  1288   1283     }
  1289   1284    
  1290   1285     /* Open the database and the input file */
  1291   1286     if( sqlite3_open(zDbName, &g.db) ){
  1292   1287       fatal_error("Cannot open database file: %s\n", zDbName);
................................................................................
  1296   1291       rc = sqlite3_db_config(g.db, SQLITE_DBCONFIG_LOOKASIDE, pLook, szLook,nLook);
  1297   1292       if( rc ) fatal_error("lookaside configuration failed: %d\n", rc);
  1298   1293     }
  1299   1294   
  1300   1295     /* Set database connection options */
  1301   1296     sqlite3_create_function(g.db, "random", 0, SQLITE_UTF8, 0, randomFunc, 0, 0);
  1302   1297     if( doTrace ) sqlite3_trace(g.db, traceCallback, 0);
         1298  +  speedtest1_exec("PRAGMA threads=%d", nThread);
  1303   1299     if( zKey ){
  1304   1300       speedtest1_exec("PRAGMA key('%s')", zKey);
  1305   1301     }
  1306   1302     if( zEncoding ){
  1307   1303       speedtest1_exec("PRAGMA encoding=%s", zEncoding);
  1308   1304     }
  1309   1305     if( doAutovac ){