/ Check-in [280d1a72]
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 | SQL 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
Context
2018-12-10
15:58
Merge the latest version of mutexfree-shmlock with this branch. check-in: 6007abfe 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: a8c5fd86 user: dan tags: mutexfree-shmlock
09:36
Avoid a mutex in-and-out in unixShmBarrier() on this branch. Use __sync_synchronize() instead. check-in: 280d1a72 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: 3aead209 user: dan tags: begin-concurrent-pnu-mutexfree-shmlock
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

  4992   4992   ** All loads and stores begun before the barrier must complete before
  4993   4993   ** any load or store begun after the barrier.
  4994   4994   */
  4995   4995   static void unixShmBarrier(
  4996   4996     sqlite3_file *fd                /* Database file holding the shared memory */
  4997   4997   ){
  4998   4998     UNUSED_PARAMETER(fd);
         4999  +#ifdef SQLITE_MUTEXFREE_SHMLOCK
         5000  +  __sync_synchronize();
         5001  +#else
  4999   5002     sqlite3MemoryBarrier();         /* compiler-defined memory barrier */
  5000   5003     assert( fd->pMethods->xLock==nolockLock 
  5001   5004          || unixFileMutexNotheld((unixFile*)fd) 
  5002   5005     );
  5003   5006     unixEnterMutex();               /* Also mutex, for redundancy */
  5004   5007     unixLeaveMutex();
         5008  +#endif
  5005   5009   }
  5006   5010   
  5007   5011   /*
  5008   5012   ** Close a connection to shared-memory.  Delete the underlying 
  5009   5013   ** storage if deleteFlag is true.
  5010   5014   **
  5011   5015   ** If there is no shared memory associated with the connection then this