Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3911ec5

Browse files
knizhnikkelvich
authored andcommitted
Make experiment with spinlocks
1 parent ed196a3 commit 3911ec5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

multimaster.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ typedef struct {
6060
csn_t snapshot; /* transaction snaphsot */
6161
} MtmCurrentTrans;
6262

63+
/* #define USE_SPINLOCK 1 */
64+
6365
typedef uint64 timestamp_t;
6466

6567
#define MTM_SHMEM_SIZE (64*1024*1024)
@@ -141,7 +143,7 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
141143
void MtmLock(LWLockMode mode)
142144
{
143145
#ifdef USE_SPINLOCK
144-
SpinLockAcquire(&ds->hashSpinlock);
146+
SpinLockAcquire(&dtm->hashSpinlock);
145147
#else
146148
LWLockAcquire(dtm->hashLock, mode);
147149
#endif
@@ -150,7 +152,7 @@ void MtmLock(LWLockMode mode)
150152
void MtmUnlock(void)
151153
{
152154
#ifdef USE_SPINLOCK
153-
SpinLockRelease(&ds->hashSpinlock);
155+
SpinLockRelease(&dtm->hashSpinlock);
154156
#else
155157
LWLockRelease(dtm->hashLock);
156158
#endif

tests/dtmbench

8.12 KB
Binary file not shown.

0 commit comments

Comments
 (0)