Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3911ec5

Browse files
knizhnikkelvich
authored andcommitted
Make experiment with spinlocks
1 parented196a3 commit3911ec5

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_tsnapshot;/* transaction snaphsot */
6161
}MtmCurrentTrans;
6262

63+
/* #define USE_SPINLOCK 1 */
64+
6365
typedefuint64timestamp_t;
6466

6567
#defineMTM_SHMEM_SIZE (64*1024*1024)
@@ -141,7 +143,7 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
141143
voidMtmLock(LWLockModemode)
142144
{
143145
#ifdefUSE_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
voidMtmUnlock(void)
151153
{
152154
#ifdefUSE_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)

[8]ページ先頭

©2009-2025 Movatter.jp