SQLite

Check-in [a8c5fd86ce]
Login

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

Overview
Comment:Avoid a mutex in-and-out in unixShmBarrier() on this branch. Use __sync_synchronize() instead.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | mutexfree-shmlock
Files: files | file ages | folders
SHA3-256: a8c5fd86ce1d9b5815f82106f2e44797b743bbb3c44aee5f835ce8d278caf8f7
User & Date: dan 2018-12-10 09:45:38.153
Context
2018-12-10
15:24
Rework the SQLITE_MUTEXFREE_SHMLOCK code to reduce contention. (check-in: d9157dd176 user: dan tags: mutexfree-shmlock)
09:45
Avoid a mutex in-and-out in unixShmBarrier() on this branch. Use __sync_synchronize() instead. (check-in: a8c5fd86ce user: dan tags: mutexfree-shmlock)
09:36
Avoid a mutex in-and-out in unixShmBarrier() on this branch. Use __sync_synchronize() instead. (check-in: 280d1a72dc user: dan tags: begin-concurrent-pnu-mutexfree-shmlock)
2018-12-06
18:58
Experiment with using an atomic CPU primitive instead of a mutex for intra-process locking with the unix-excl VFS. (check-in: 8f4cb9dd33 user: dan tags: mutexfree-shmlock)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/os_unix.c.
4970
4971
4972
4973
4974
4975
4976



4977
4978
4979
4980
4981
4982

4983
4984
4985
4986
4987
4988
4989
** All loads and stores begun before the barrier must complete before
** any load or store begun after the barrier.
*/
static void unixShmBarrier(
  sqlite3_file *fd                /* Database file holding the shared memory */
){
  UNUSED_PARAMETER(fd);



  sqlite3MemoryBarrier();         /* compiler-defined memory barrier */
  assert( fd->pMethods->xLock==nolockLock 
       || unixFileMutexNotheld((unixFile*)fd) 
  );
  unixEnterMutex();               /* Also mutex, for redundancy */
  unixLeaveMutex();

}

/*
** Close a connection to shared-memory.  Delete the underlying 
** storage if deleteFlag is true.
**
** If there is no shared memory associated with the connection then this







>
>
>






>







4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
** All loads and stores begun before the barrier must complete before
** any load or store begun after the barrier.
*/
static void unixShmBarrier(
  sqlite3_file *fd                /* Database file holding the shared memory */
){
  UNUSED_PARAMETER(fd);
#ifdef SQLITE_MUTEXFREE_SHMLOCK
  __sync_synchronize();
#else
  sqlite3MemoryBarrier();         /* compiler-defined memory barrier */
  assert( fd->pMethods->xLock==nolockLock 
       || unixFileMutexNotheld((unixFile*)fd) 
  );
  unixEnterMutex();               /* Also mutex, for redundancy */
  unixLeaveMutex();
#endif
}

/*
** Close a connection to shared-memory.  Delete the underlying 
** storage if deleteFlag is true.
**
** If there is no shared memory associated with the connection then this