Lines Matching defs:shared

1268 ** write ahead log ([WAL file]) and shared memory
1274 ** to read the database file, as the WAL and shared memory files must exist
3758 ** if shared cache mode is enabled, but the "filename" is otherwise ignored.
3775 ** <dd>The database is opened [shared cache] enabled, overriding
3776 ** the default shared cache setting provided by
3778 ** The [use of shared cache mode is discouraged] and hence shared cache
3783 ** <dd>The database is opened [shared cache] disabled, overriding
3784 ** the default shared cache setting provided by
3886 ** <li> <b>cache</b>: ^The cache parameter may be set to either "shared" or
3887 ** "private". ^Setting it to "shared" is equivalent to setting the
3943 ** Regardless of whether or not shared-cache mode is enabled by
6999 ** [use of shared cache mode is discouraged].
7011 ** ^(This routine returns [SQLITE_OK] if shared cache was enabled or disabled
7017 ** discouraged. Any use of shared cache is discouraged. If shared cache
7018 ** must be used, it is recommended that shared cache only be enabled for
7024 ** shared cache mode should be enabled per-database connection via
7270 const char *zFile, /* Name of the shared library containing extension */
8804 ** pager cache is shared between two or more connections the bytes of heap
8807 ** with the database connection are shared, this request returns the same
8809 ** shared, the value returned by this call will be smaller than that returned
8818 ** schema memory is shared with other database connections due to
8819 ** [shared cache mode] being enabled.
9329 ** sqlite3_backup_step() obtains a [shared lock] on the source database that
9396 ** If running in [shared cache mode], the application must
9397 ** guarantee that the shared cache used by the destination database
9425 ** ^When running in shared-cache mode, a database operation may fail with
9426 ** an [SQLITE_LOCKED] error if the required locks on the shared-cache or
9427 ** individual tables within the shared-cache cannot be obtained. See
9428 ** [SQLite Shared-Cache Mode] for a description of shared-cache locking.
9440 ** shared-cache lock and SQLITE_LOCKED is returned to the caller, the
9457 ** shared-cache table, and more than one other connection currently holds
15069 ** a random byte is selected for a shared lock. The pool of bytes for
15070 ** shared locks begins at SHARED_FIRST.
15074 ** clients on win95, winNT, and unix all talking to the same shared file
15796 ** If we are not using shared cache, then there is no need to
16793 Schema *pSchema; /* Pointer to database schema (possibly shared) */
16801 ** In shared cache mode, a single Schema object can be shared by multiple
16871 ** be stored in lookaside because in shared cache mode the schema information
16872 ** is shared by multiple database connections. Therefore, while parsing
17039 u8 noSharedCache; /* True if no shared-cache backends */
17062 void **aExtension; /* Array of shared library handles */
17191 #define SQLITE_ReadUncommit 0x00000400 /* READ UNCOMMITTED in shared-cache */
17692 ** If the database schema is shared, then there is one instance of this
17693 ** structure for each database connection (sqlite3*) that uses the shared
17696 ** implementation. sqlite3_vtab* handles can not be shared between
17698 ** schema is shared, as the implementation often stores the database
17706 ** All VTable objects that correspond to a single table in a shared
19100 ** The nTableLock and aTableLock variables are only used if the shared-cache
19147 TableLock *aTableLock; /* Required table locks for shared-cache mode */
19495 int sharedCacheEnabled; /* true if shared-cache mode enabled */
36967 typedef struct unixShm unixShm; /* Connection shared memory */
37534 ** shared by multiple threads.
37893 ** cnt>0 means there are cnt shared locks on the file.
37992 unsigned long long sharedByte; /* for AFP simulated shared lock */
38487 ** lock transitions in terms of the POSIX advisory shared and exclusive
38494 ** byte', each single bytes at well known offsets, and the 'shared byte
38498 ** byte'. If this is successful, 'shared byte range' is read-locked
38501 ** and Widnows95 lacks a shared-lock capability. So on Windows95, a
38502 ** single randomly selected by from the 'shared byte range' is locked.
38504 ** lack of shared-locks on Windows95 lives on, for backwards
38520 ** implemented by obtaining a write-lock on the entire 'shared byte
38548 ** (1) We never move from unlocked to anything higher than shared lock.
38550 ** (3) A shared lock is always held when a reserve lock is requested.
38556 /* This mutex is needed because pFile->pInode is shared across threads
38647 ** same process is still holding a shared lock. */
38768 /* downgrading to a shared lock on NFS involves clearing the write lock
38852 /* Decrement the shared lock counter. Release the lock using an
39172 /* To downgrade to shared, simply update our internal notion of the
39383 /* shared can just be set because we always have an exclusive */
39551 /* shared can just be set because we always have an exclusive */
39770 ** (1) We never move from unlocked to anything higher than shared lock.
39772 ** (3) A shared lock is always held when a reserve lock is requested.
39778 /* This mutex is needed because pFile->pInode is shared across threads
39862 ** same process is still holding a shared lock. */
39881 /* Remove the shared lock before trying the range. we'll need to
39882 ** reestablish the shared lock if we can't get the afpUnlock
39892 /* Can't reestablish the shared lock. Sqlite can't deal, this is
39976 /* only re-establish the shared lock if necessary */
39998 /* Decrement the shared lock counter. Release the lock using an
41141 ** Object used to represent an shared memory buffer.
41150 ** every open file that does not use shared memory (in other words, most
41174 int szRegion; /* Size of shared-memory regions */
41178 char **apRegion; /* Array of mapped shared-memory regions */
41181 int aLock[SQLITE_SHM_NLOCK]; /* # shared locks on slot, -1==excl lock */
41184 u8 sharedMask; /* Mask of shared locks held */
41191 ** open shared memory connection.
41207 u16 sharedMask; /* Mask of shared locks held */
41263 unixShmNode *pShmNode; /* Apply locks to this open shared-memory segment */
41353 ** This is not a VFS shared-memory method; it is a utility function called
41354 ** by VFS shared-memory methods.
41445 ** Open a shared-memory area associated with open database file pDbFd.
41448 ** The file used to implement shared-memory is in the same directory
41452 ** for shared memory will be called "/home/user1/config.db-shm".
41458 ** database to end up using different files for shared memory -
41459 ** meaning that their memory would not really be shared - resulting
41469 ** When opening a new shared-memory file, if no other instances of that
41476 ** that case, we do not really need shared memory. No shared memory
41477 ** file is created. The shared memory will be simulated with heap memory.
41604 ** shared-memory associated with the database file fd. Shared-memory regions
41605 ** are numbered starting from zero. Each shared-memory region is szRegion
41610 ** Otherwise, if the bExtend parameter is 0 and the requested shared-memory
41613 ** bExtend is non-zero and the requested shared-memory region has not yet
41616 ** If the shared-memory region has already been allocated or is allocated by
41635 /* If the shared-memory file has not yet been opened, open it now. */
41789 ** Change the lock state for a shared-memory segment.
41793 ** to shared and back or from unlocked to exclusive and back. But one may
41794 ** not go from shared to exclusive or from exclusive to shared.
41797 sqlite3_file *fd, /* Database file holding the shared memory */
41802 unixFile *pDbFd = (unixFile*)fd; /* Connection holding shared memory */
41803 unixShm *p; /* The shared memory being locked */
41900 /* Get the local shared locks */
41939 ** Implement a memory barrier or memory fence on shared memory.
41945 sqlite3_file *fd /* Database file holding the shared memory */
41957 ** Close a connection to shared-memory. Delete the underlying
41960 ** If there is no shared memory associated with the connection then this
41965 int deleteFlag /* Delete shared-memory if true */
41968 unixShmNode *pShmNode; /* The underlying shared-memory file */
41992 ** shared-memory file, too */
42310 3, /* shared memory and mmap are enabled */
42320 3, /* shared memory and mmap are enabled */
42330 1, /* shared memory is disabled */
42342 1, /* shared memory is disabled */
42355 1, /* shared memory is disabled */
42368 1, /* shared memory is disabled */
42394 1, /* shared memory is disabled */
42408 1, /* shared memory is disabled */
43516 ** Interfaces for opening a shared library, finding entry points
43517 ** within the shared library, and closing the shared library.
43749 ** To simulate a F_RDLCK on the shared range, on AFP a randomly selected
43750 ** address in the shared range is taken for a SHARED lock, the entire
43751 ** shared range is taken for an EXCLUSIVE lock):
43818 ** by taking an sqlite-style shared lock on the conch file, reading the
43826 ** path and the lock is downgraded to a shared lock again. If the conch
43827 ** is held by another process (with a shared lock), the exclusive lock
43839 ** The shared lock and an open file descriptor are maintained until
44266 /* Takes the conch by taking a shared lock and read the contents conch, if
44371 ** has a shared lock already), if the host id matches, use the big
44378 ** same process is still holding a shared lock. */
45314 typedef struct winShm winShm; /* A connection to shared-memory */
45315 typedef struct winShmNode winShmNode; /* A region of shared-memory */
45341 short sharedLockByte; /* Randomly chosen byte used as a shared lock */
45345 winShm *pShm; /* Instance of shared memory on this file */
45351 HANDLE hMutex; /* Mutex used to control access to shared lock */
45354 winceLock *shared; /* Global shared lock memory for the file */
47321 ** Create the mutex and shared memory used for locking in the file
47361 ** and using that as the shared filemapping name.
47377 /* If we succeeded in making the shared memory handle, map it. */
47379 pFile->shared = (winceLock*)osMapViewOfFile(pFile->hShared,
47381 /* If mapping failed, close the shared memory handle and erase it */
47382 if( !pFile->shared ){
47392 /* If shared memory could not be created, then close the mutex and fail */
47406 /* Initialize the shared memory if we're supposed to */
47408 memset(pFile->shared, 0, sizeof(winceLock));
47426 pFile->shared->nReaders --;
47429 pFile->shared->bReserved = FALSE;
47432 pFile->shared->bPending = FALSE;
47435 pFile->shared->bExclusive = FALSE;
47438 /* De-reference and close our copy of the shared memory handle */
47439 osUnmapViewOfFile(pFile->shared);
47471 if (pFile->shared->nReaders == 0 && pFile->shared->bExclusive == 0){
47472 pFile->shared->bExclusive = TRUE;
47481 if (pFile->shared->bExclusive == 0){
47484 pFile->shared->nReaders ++;
47494 if (pFile->shared->bPending == 0) {
47495 pFile->shared->bPending = TRUE;
47504 if (pFile->shared->bReserved == 0) {
47505 pFile->shared->bReserved = TRUE;
47540 pFile->shared->bExclusive = FALSE;
47551 pFile->shared->nReaders --;
47562 pFile->shared->bPending = FALSE;
47571 pFile->shared->bReserved = FALSE;
48384 /* Acquire a shared lock
48753 ** this file, all of which may be shared by multiple threads.
48778 ** shared memory. When multiple threads all reference the same
48804 int szRegion; /* Size of shared-memory regions */
48832 ** open shared memory connection.
48847 u16 sharedMask; /* Mask of shared locks held */
48867 winShmNode *pFile, /* Apply locks to this open shared-memory segment */
48911 ** This is not a VFS shared-memory method; it is a utility function called
48912 ** by VFS shared-memory methods.
48988 ** Open the shared-memory area associated with database file pDbFd.
48990 ** When opening a new shared-memory file, if no other instances of that
49100 ** Close a connection to shared-memory. Delete the underlying
49104 sqlite3_file *fd, /* Database holding shared memory */
49107 winFile *pDbFd; /* Database holding shared-memory */
49109 winShmNode *pShmNode; /* The underlying shared-memory file */
49129 ** shared-memory file, too */
49142 ** Change the lock state for a shared-memory segment.
49145 sqlite3_file *fd, /* Database file holding the shared memory */
49150 winFile *pDbFd = (winFile*)fd; /* Connection holding shared memory */
49151 winShm *p = pDbFd->pShm; /* The shared memory being locked */
49197 /* Find out which shared locks are already held by sibling connections.
49209 /* Get shared locks at the system level, if necessary */
49218 /* Get the local shared locks */
49252 ** Implement a memory barrier or memory fence on shared memory.
49258 sqlite3_file *fd /* Database holding the shared memory */
49268 ** shared-memory associated with the database file fd. Shared-memory regions
49269 ** are numbered starting from zero. Each shared-memory region is szRegion
49274 ** Otherwise, if the isWrite parameter is 0 and the requested shared-memory
49277 ** isWrite is non-zero and the requested shared-memory region has not yet
49280 ** If the shared-memory region has already been allocated or is allocated by
50850 ** Interfaces for opening a shared library, finding entry points
50851 ** within the shared library, and closing the shared library.
51307 ** An memdb object can be shared or separate. Shared memdb objects can be
51308 ** used by more than one database connection. Mutexes are used by shared
51315 ** "/" or else the object will be a separate memdb object. All shared
51321 ** Access rules for shared MemStore objects:
51346 sqlite3_mutex *pMutex; /* Used by shared stores only */
51352 char *zFName; /* The filename for shared stores */
51369 int nMemStore; /* Number of shared MemStore objects */
51370 MemStore **apMemStore; /* Array of all shared MemStore objects */
55473 ** WAL module is using shared-memory, return false.
56146 u8 hasHeldSharedLock; /* True if a shared lock has ever been held */
57658 ** connection to obtain a shared lock on the pager (which may be this one)
58520 ** pPg->pData. A shared lock or greater must be held on the database
60750 ** This function is called to obtain a shared lock on the database file.
60752 ** has been successfully called. If a shared-lock is already held when
60913 /* The shared-lock has just been acquired then check to
62582 ** shared cache, it uses nullIfMemDb==0 so that in-memory databases can
62583 ** participate in shared-cache.
63115 ** in. Otherwise, use the normal shared-memory.
63124 ** heap-memory for the wal-index instead of the VFS shared-memory
63490 ** Conceptually, the wal-index is shared memory, though VFS implementations
63492 ** the wal-index is shared memory, SQLite does not support journal_mode=WAL
63731 ** since the reader will be holding a shared lock on WAL_READ_LOCK(K).
64287 ** Set or release locks on the WAL. Locks are either shared or exclusive.
64288 ** A lock cannot be moved directly between shared and exclusive - it must go
65341 ** This function updates the shared-memory structures so that the next
65562 ** wal-index header in shared memory, as all subsequent reader or
65671 ** The wal-index is in shared memory. Another thread or process might
65687 WalIndexHdr volatile *aHdr; /* Header in shared memory */
65693 ** same area of shared memory on a different CPU in a SMP,
65705 ** shared among multiple processes and not all mutex implementions work
65767 /* The SQLITE_READONLY_CANTINIT return means that the shared-memory
65769 ** confirm that another write-capable connection has the shared-memory
65770 ** open, and hence the content of the shared-memory is unreliable,
65771 ** since the shared-memory might be inconsistent with the WAL file
65852 ** Open a transaction in a connection where the shared-memory is read-only
65854 ** on hand to keep the shared-memory up-to-date with the WAL file.
65856 ** This can happen, for example, when the shared-memory is implemented by
65865 ** constructed in pWal->apWiData[] using heap memory instead of shared
65903 /* Check to see if a separate writer has attached to the shared-memory area,
65904 ** thus making the shared-memory "reliable" again. Do this by invoking
65908 ** If the shared-memory is now "reliable" return WAL_RETRY, which will
65910 ** shared memory to be used in its place.
65921 ** even if some external agent does a "chmod" to make the shared-memory
65932 /* We reach this point only if the real shared-memory is still unreliable.
66138 ** code that determines whether or not the shared-memory region
66246 ** between the time it was read and when the shared-lock was obtained
66262 ** nBackfill and checking that the wal-header in shared-memory still
66402 ** there is no checkpointer process by taking a shared CKPT lock
66474 /* Release the shared CKPT lock obtained above. */
66998 WalIndexHdr *pLive; /* Pointer to shared header */
67429 ** WAL module is using shared-memory, return false.
67899 ** shared between multiple connections. In that case, each connection
67934 ** If the shared-data extension is enabled, there may be multiple users
67977 ** the shared-cache enters 'pending-lock' state and isPending is
67980 ** The shared-cache leaves the 'pending lock' state when either of
68021 BtLock *pLock; /* List of locks held on this shared-btree struct */
68072 ** A single database file can be shared by two more database connections,
68073 ** but cursors cannot be shared. Each cursor is associated with a
68357 ** the same connection. Only shared Btrees are on the list. */
68551 ** in single threaded applications that use shared cache. Except for
68555 ** If shared cache is disabled, then all btree mutex routines, including
68662 ** in shared cache. This variable has file scope during normal builds,
68677 ** Enable or disable the shared pager and schema features.
68680 ** The shared cache setting effects only future calls to
68696 ** shared-cache table level locks. If the library is compiled with the
68697 ** shared-cache feature disabled, then there is only ever one user
68872 ** table or index rooted at iRoot because other shared connections are
68922 /* This routine is a no-op if the shared-cache is not enabled */
68962 ** Add a lock on the table with root-page iTable to the shared-btree used
69116 ** database connetion. This is important in shared-cache mode. If the database
69131 ** on the shared btree structure pBt.
69137 ** on the shared btree structure pBt.
71065 ** and we are in shared cache mode, then the open will fail with an
71129 ** If this Btree is a candidate for shared cache, try to find an
71342 ** default value. Except, when opening on an existing shared pager-cache,
71482 /* If there are still other outstanding references to the shared-btree
71484 ** up the shared-btree.
71649 ** known that the shared b-tree mutex is held, but the mutex on the
72160 ** on this shared-btree structure and a second write transaction is
72185 ** page 1. So if some other shared-cache client already has a write-lock
72828 ** transaction count of the shared btree. If the transaction count
72829 ** reaches 0, set the shared state to TRANS_NONE. The unlockBtreeIfUnused()
72880 /* If the handle has a write-transaction open, commit the shared-btrees
72881 ** transaction and set the shared state to TRANS_READ.
79493 ** transaction on the shared-cache the argument Btree is connected to.
79524 ** a single shared-btree. The memory is used by client code for its own
79526 ** the shared-btree). The btree layer manages reference counting issues.
79528 ** The first time this is called on a shared-btree, nBytes bytes of memory
79537 ** Just before the shared-btree is closed, the function passed as the
79554 ** Return SQLITE_LOCKED_SHAREDCACHE if another user of the same shared
79737 ** this is always 1. For shared caches it may be 1 or greater.
79985 ** guaranteed that the shared-mutex is held by this thread, handle
84415 ** If SQLite is compiled to support shared-cache mode and to be threadsafe,
84421 ** If SQLite is not threadsafe but does support shared-cache mode, then
84426 ** If SQLite is not threadsafe and does not support shared-cache mode, this
84431 ** corresponding to btrees that use shared cache. Then the runtime of
94166 ** there are active writing VMs or active VMs that use shared cache.
98084 ** in temporary storage or if the VFS does not support shared memory
98088 || !sqlite3PagerWalSupported(pPager)) /* No shared-memory support */
98250 ** the shared-cache feature is enabled.
115643 /* Establish a read-lock on the table at the shared-cache level.
117696 ** shared-cache feature is enabled.
120281 ** A shared-cache write-lock is not required to write to the new table,
126225 ** A function that loads a shared-library extension then returns NULL.
128111 /* Take a shared-cache advisory read-lock on the parent table. Allocate
131940 ** shared libraries that want to be imported as extensions into
131956 ** versions of SQLite will not be able to load each other's shared
133171 const char *zFile, /* Name of the shared library containing extension */
133273 "no entry point [%s] in shared library [%s]", zEntry, zFile);
133293 /* Append the new shared library handle to the db->aExtension array. */
133314 "unable to open shared library [%.*s]", SQLITE_MAX_PATHLEN, zFile);
133322 const char *zFile, /* Name of the shared library containing extension */
133368 ** This list is shared across threads. The SQLITE_MUTEX_STATIC_MAIN
136742 "unlocked", "shared", "reserved", "pending", "exclusive"
150206 ** be being used by other shared-cache connections).
150230 ** shared b-tree databases opened using connection db are held by the
166309 ** shared across database connections.
174866 ** here, then another shared-cache connection might sneak in between
176489 { "shared", SQLITE_OPEN_SHAREDCACHE },
178499 ** (call it pOther) in the same process was busy using the same shared
178832 ** varint nPrefix; (length of prefix shared with previous term)
178878 ** varint nPrefix; (length of shared prefix with previous term)
190401 ** shared-cache table-lock on the %_segdir table. This is required before
191887 ** Return the size of the common prefix (if any) shared by zPrev and
193908 int nPrefix; /* Size of prefix shared with previous term */
213708 ** Take or release a shared-memory lock.
246239 const char *lock_name_list[DB_LOCK_NUM] = {"pending lock ", "reserved lock", "shared lock "};