Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
82b36846
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
82b36846
编写于
7月 16, 2007
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add comments spelling out why it's a good idea to release multiple
partition locks in reverse order.
上级
e9e97500
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
6 deletion
+14
-6
src/backend/storage/lmgr/lock.c
src/backend/storage/lmgr/lock.c
+8
-2
src/backend/storage/lmgr/proc.c
src/backend/storage/lmgr/proc.c
+6
-4
未找到文件。
src/backend/storage/lmgr/lock.c
浏览文件 @
82b36846
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lock.c,v 1.17
6 2007/02/01 19:10:28 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lock.c,v 1.17
7 2007/07/16 21:09:50 tgl
Exp $
*
*
* NOTES
* NOTES
* A lock table is a shared memory hash table. When
* A lock table is a shared memory hash table. When
...
@@ -2119,7 +2119,13 @@ GetLockStatusData(void)
...
@@ -2119,7 +2119,13 @@ GetLockStatusData(void)
el
++
;
el
++
;
}
}
/* And release locks */
/*
* And release locks. We do this in reverse order for two reasons:
* (1) Anyone else who needs more than one of the locks will be trying
* to lock them in increasing order; we don't want to release the other
* process until it can get all the locks it needs.
* (2) This avoids O(N^2) behavior inside LWLockRelease.
*/
for
(
i
=
NUM_LOCK_PARTITIONS
;
--
i
>=
0
;)
for
(
i
=
NUM_LOCK_PARTITIONS
;
--
i
>=
0
;)
LWLockRelease
(
FirstLockMgrLock
+
i
);
LWLockRelease
(
FirstLockMgrLock
+
i
);
...
...
src/backend/storage/lmgr/proc.c
浏览文件 @
82b36846
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/lmgr/proc.c,v 1.19
0 2007/06/19 22:01:15
tgl Exp $
* $PostgreSQL: pgsql/src/backend/storage/lmgr/proc.c,v 1.19
1 2007/07/16 21:09:50
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1168,9 +1168,11 @@ CheckDeadLock(void)
...
@@ -1168,9 +1168,11 @@ CheckDeadLock(void)
}
}
/*
/*
* Release locks acquired at head of routine. Order is not critical, so
* And release locks. We do this in reverse order for two reasons:
* do it back-to-front to avoid waking another CheckDeadLock instance
* (1) Anyone else who needs more than one of the locks will be trying
* before it can get all the locks.
* to lock them in increasing order; we don't want to release the other
* process until it can get all the locks it needs.
* (2) This avoids O(N^2) behavior inside LWLockRelease.
*/
*/
check_done:
check_done:
for
(
i
=
NUM_LOCK_PARTITIONS
;
--
i
>=
0
;)
for
(
i
=
NUM_LOCK_PARTITIONS
;
--
i
>=
0
;)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录