/ Check-in [1cab8357]
Login

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

Overview
Comment:Enable four sorting threads by default in the command-line shell.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | threads
Files: files | file ages | folders
SHA1: 1cab83577c814feb35b4fb91af0d52a9751d99bc
User & Date: drh 2014-03-25 14:12:16
Context
2014-03-26
19:45
Merge from trunk the fix for the crash on a corrupt database. check-in: 8cb2b02b user: drh tags: threads
2014-03-25
14:12
Enable four sorting threads by default in the command-line shell. check-in: 1cab8357 user: drh tags: threads
13:17
Merge all fixes and enhancements from trunk. check-in: b415dfb6 user: drh tags: threads
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.

  3528   3528     data->mode = MODE_List;
  3529   3529     memcpy(data->separator,"|", 2);
  3530   3530     data->showHeader = 0;
  3531   3531     sqlite3_config(SQLITE_CONFIG_URI, 1);
  3532   3532     sqlite3_config(SQLITE_CONFIG_LOG, shellLog, data);
  3533   3533     sqlite3_snprintf(sizeof(mainPrompt), mainPrompt,"sqlite> ");
  3534   3534     sqlite3_snprintf(sizeof(continuePrompt), continuePrompt,"   ...> ");
  3535         -  sqlite3_config(SQLITE_CONFIG_SINGLETHREAD);
  3536   3535   }
  3537   3536   
  3538   3537   /*
  3539   3538   ** Output text to the console in a font that attracts extra attention.
  3540   3539   */
  3541   3540   #ifdef _WIN32
  3542   3541   static void printBold(const char *zText){

Changes to src/threads.c.

    24     24   ** This interface exists so that applications that want to take advantage
    25     25   ** of multiple cores can do so, while also allowing applications to stay
    26     26   ** single-threaded if desired.
    27     27   */
    28     28   #include "sqliteInt.h"
    29     29   
    30     30   /********************************* Unix Pthreads ****************************/
    31         -#if SQLITE_OS_UNIX && defined(SQLITE_MUTEX_PTHREADS)
           31  +#if SQLITE_OS_UNIX && defined(SQLITE_MUTEX_PTHREADS) && SQLITE_THREADSAFE>0
    32     32   
    33     33   #define SQLITE_THREADS_IMPLEMENTED 1  /* Prevent the single-thread code below */
    34     34   #include <pthread.h>
    35     35   
    36     36   /* A running thread */
    37     37   struct SQLiteThread {
    38     38     pthread_t tid;
................................................................................
    81     81   }
    82     82   
    83     83   #endif /* SQLITE_OS_UNIX && defined(SQLITE_MUTEX_PTHREADS) */
    84     84   /******************************** End Unix Pthreads *************************/
    85     85   
    86     86   
    87     87   /********************************* Win32 Threads ****************************/
    88         -#if SQLITE_OS_WIN && !SQLITE_OS_WINRT
           88  +#if SQLITE_OS_WIN && !SQLITE_OS_WINRT && SQLITE_THREADSAFE>0
    89     89   
    90     90   #define SQLITE_THREADS_IMPLEMENTED 1  /* Prevent the single-thread code below */
    91     91   #include <process.h>
    92     92   
    93     93   /* A running thread */
    94     94   struct SQLiteThread {
    95     95     uintptr_t tid;           /* The thread handle */

Changes to src/vdbesort.c.

    27     27   
    28     28   
    29     29   /*
    30     30   ** Maximum number of threads to use. Setting this value to 1 forces all
    31     31   ** operations to be single-threaded.
    32     32   */
    33     33   #ifndef SQLITE_MAX_SORTER_THREAD
    34         -# define SQLITE_MAX_SORTER_THREAD 1
           34  +# define SQLITE_MAX_SORTER_THREAD 4
    35     35   #endif
    36     36   
    37     37   /*
    38     38   ** Candidate values for SorterThread.eWork
    39     39   */
    40     40   #define SORTER_THREAD_SORT   1
    41     41   #define SORTER_THREAD_TO_PMA 2