mirror of
https://gitee.com/he3db/he3pg.git
synced 2024-11-29 18:58:35 +08:00
mutex control parallel replay
Code Source From: Self Code Description: 【Optional】 Jira: #【Optional】 市场项目编号(名称):【Optional】
This commit is contained in:
parent
b7b55615eb
commit
ca0862b157
@ -490,6 +490,7 @@ void pushSlaveReplayQueue(int pageNum) {
|
||||
SpinLockRelease(&PageHashQueueShmem->mutex);
|
||||
WakeupFlushWork();
|
||||
}
|
||||
|
||||
while(pageNum > CompletedTaskNum()) {
|
||||
pg_usleep(1000L);
|
||||
}
|
||||
@ -662,12 +663,14 @@ void SortPageQueue(void) {
|
||||
BufferTag* QueuePushPage(void) {
|
||||
uint32_t gpushpos;
|
||||
bool hasData = false;
|
||||
SpinLockAcquire(&PageHashQueueShmem->mutex);
|
||||
if (PageHashQueueShmem->ready == true && PageHashQueueShmem->gpushpos < PageHashQueueShmem->gpos) {
|
||||
hasData = true;
|
||||
gpushpos = PageHashQueueShmem->gpushpos++;
|
||||
if (PageHashQueueShmem->ready == true) {
|
||||
SpinLockAcquire(&PageHashQueueShmem->mutex);
|
||||
if (PageHashQueueShmem->ready == true && PageHashQueueShmem->gpushpos < PageHashQueueShmem->gpos) {
|
||||
hasData = true;
|
||||
gpushpos = PageHashQueueShmem->gpushpos++;
|
||||
}
|
||||
SpinLockRelease(&PageHashQueueShmem->mutex);
|
||||
}
|
||||
SpinLockRelease(&PageHashQueueShmem->mutex);
|
||||
if (hasData == false) {
|
||||
return NULL;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user