SQLite

Check-in [280d1a72dc]
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 | begin-concurrent-pnu-mutexfree-shmlock
Files: files | file ages | folders
SHA3-256: 280d1a72dc269b4402853159949d7a905d414786074f5d80e951c9341ebbd1b5
User & Date: dan 2018-12-10 09:36:34.858
Context
2018-12-10
15:58
Merge the latest version of mutexfree-shmlock with this branch. (check-in: 6007abfe09 user: dan tags: begin-concurrent-pnu-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
20:26
Add the mutexfree-shmlock experiment to the begin-concurrent-pnu branch. (check-in: 3aead209b4 user: dan tags: begin-concurrent-pnu-mutexfree-shmlock)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/os_unix.c.
4992
4993
4994
4995
4996
4997
4998



4999
5000
5001
5002
5003
5004

5005
5006
5007
5008
5009
5010
5011
** 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







>
>
>






>







4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
** 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