Skip to content

Commit 7d54219

Browse files
committed
Make experiment with spinlocks
1 parent 6b07b6b commit 7d54219

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

contrib/mmts/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

contrib/mmts/tests/dtmbench

8.12 KB
Binary file not shown.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy