/ Check-in [3c566e41]
Login

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

Overview
Comment:Merge change to drop the mutex on the multiplexor before entering the xRead VFS call, in order to enhance parallelizability.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:3c566e41e4c9c66960cc5a3ddee8556835237999
User & Date: drh 2013-11-08 12:14:50
Context
2013-11-08
15:19
Performance improvements: Avoid unnecessary seeks when doing a single-row UPDATE on a WITHOUT ROWID table. check-in: 6f187a0f user: drh tags: trunk
12:14
Merge change to drop the mutex on the multiplexor before entering the xRead VFS call, in order to enhance parallelizability. check-in: 3c566e41 user: drh tags: trunk
01:09
Optimize out a NotExists/NotFound opcode that occurs in UPDATE processing after constraint checks if there is no possiblity that the constraint checking code might have moved the cursor. check-in: 74e3ee2e user: drh tags: trunk
2013-10-21
13:15
Drop the mutex on the multiplexor before entering the xRead VFS call. Closed-Leaf check-in: a00d2ed4 user: drh tags: multiplex-parallel-read
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/test_multiplex.c.

   751    751     void *pBuf,
   752    752     int iAmt,
   753    753     sqlite3_int64 iOfst
   754    754   ){
   755    755     multiplexConn *p = (multiplexConn*)pConn;
   756    756     multiplexGroup *pGroup = p->pGroup;
   757    757     int rc = SQLITE_OK;
   758         -  multiplexEnter();
          758  +  int nMutex = 0;
          759  +  multiplexEnter(); nMutex++;
   759    760     if( !pGroup->bEnabled ){
   760    761       sqlite3_file *pSubOpen = multiplexSubOpen(pGroup, 0, &rc, NULL, 0);
          762  +    multiplexLeave(); nMutex--;
   761    763       if( pSubOpen==0 ){
   762    764         rc = SQLITE_IOERR_READ;
   763    765       }else{
   764    766         rc = pSubOpen->pMethods->xRead(pSubOpen, pBuf, iAmt, iOfst);
   765    767       }
   766    768     }else{
   767    769       while( iAmt > 0 ){
   768    770         int i = (int)(iOfst / pGroup->szChunk);
          771  +      if( nMutex==0 ){ multiplexEnter(); nMutex++; }
   769    772         sqlite3_file *pSubOpen = multiplexSubOpen(pGroup, i, &rc, NULL, 1);
          773  +      multiplexLeave(); nMutex--;
   770    774         if( pSubOpen ){
   771    775           int extra = ((int)(iOfst % pGroup->szChunk) + iAmt) - pGroup->szChunk;
   772    776           if( extra<0 ) extra = 0;
   773    777           iAmt -= extra;
   774    778           rc = pSubOpen->pMethods->xRead(pSubOpen, pBuf, iAmt,
   775    779                                          iOfst % pGroup->szChunk);
   776    780           if( rc!=SQLITE_OK ) break;
................................................................................
   779    783           iAmt = extra;
   780    784         }else{
   781    785           rc = SQLITE_IOERR_READ;
   782    786           break;
   783    787         }
   784    788       }
   785    789     }
   786         -  multiplexLeave();
          790  +  assert( nMutex==0 || nMutex==1 );
          791  +  if( nMutex ) multiplexLeave();
   787    792     return rc;
   788    793   }
   789    794   
   790    795   /* Pass xWrite requests thru to the original VFS after
   791    796   ** determining the correct chunk to operate on.
   792    797   ** Break up writes across chunk boundaries.
   793    798   */