Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xindoo
redis
提交
a97b9060
R
redis
项目概览
xindoo
/
redis
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a97b9060
编写于
3月 19, 2010
作者:
A
antirez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
VM hash type swappability implemented. Handling of failed pthread_create() call.
上级
c77169b7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
39 addition
and
4 deletion
+39
-4
TODO
TODO
+1
-3
redis.c
redis.c
+38
-1
未找到文件。
TODO
浏览文件 @
a97b9060
...
...
@@ -8,8 +8,6 @@ VERSION 2.0 TODO
* Save dataset / fsync() on SIGTERM
* MULTI/EXEC should support the "EXEC FSYNC" form?
* BLPOP & C. tests (write a non blocking Tcl client as first step)
* ZCOUNT sortedset min max
* ZRANK: http://docs.google.com/viewer?a=v&q=cache:tCQaP3ZeN4YJ:courses.csail.mit.edu/6.046/spring04/handouts/ps5-sol.pdf+skip+list+rank+operation+augmented&hl=en&pid=bl&srcid=ADGEEShXuNjTcZyXw_1cq9OaWpSXy3PprjXqVzmM-LE0ETFznLyrDXJKQ_mBPNT10R8ErkoiXD9JbMw_FaoHmOA4yoGVrA7tZWiy393JwfCwuewuP93sjbkzZ_gnEp83jYhPYjThaIzw&sig=AHIEtbRF0GkYCdYRFtTJBE69senXZwFY0w
* Once ZRANK is implemented, change the implementation of ZCOUNT to use the augmented skiplist in order to be much faster.
* Write doc for ZCOUNT, and for open / closed intervals of sorted sets range operations.
...
...
@@ -29,7 +27,7 @@ Virtual Memory sub-TODO:
* Hashes (GET/SET/DEL/INCRBY/EXISTS/FIELDS/LEN/MSET/MGET). Special encoding for hashes with less than N elements.
* Write documentation for APPEND
* Implement LEN,
SUBSTR,
PEEK, POKE, SETBIT, GETBIT
* Implement LEN, PEEK, POKE, SETBIT, GETBIT
VERSION 2.2 TODO (Fault tolerant sharding)
===========================================
...
...
redis.c
浏览文件 @
a97b9060
...
...
@@ -8318,6 +8318,38 @@ static double computeObjectSwappability(robj *o) {
if
(
z
)
asize
+=
sizeof
(
zskiplistNode
)
*
dictSize
(
d
);
}
break
;
case
REDIS_HASH
:
if
(
o
->
encoding
==
REDIS_ENCODING_ZIPMAP
)
{
unsigned
char
*
p
=
zipmapRewind
((
unsigned
char
*
)
o
->
ptr
);
unsigned
int
len
=
zipmapLen
((
unsigned
char
*
)
o
->
ptr
);
unsigned
int
klen
,
vlen
;
unsigned
char
*
key
,
*
val
;
if
((
p
=
zipmapNext
(
p
,
&
key
,
&
klen
,
&
val
,
&
vlen
))
==
NULL
)
{
klen
=
0
;
vlen
=
0
;
}
asize
=
len
*
(
klen
+
vlen
+
3
);
}
else
if
(
o
->
encoding
==
REDIS_ENCODING_HT
)
{
d
=
o
->
ptr
;
asize
=
sizeof
(
dict
)
+
(
sizeof
(
struct
dictEntry
*
)
*
dictSlots
(
d
));
if
(
dictSize
(
d
))
{
long
elesize
;
robj
*
ele
;
de
=
dictGetRandomKey
(
d
);
ele
=
dictGetEntryKey
(
de
);
elesize
=
(
ele
->
encoding
==
REDIS_ENCODING_RAW
)
?
(
sizeof
(
*
o
)
+
sdslen
(
ele
->
ptr
))
:
sizeof
(
*
o
);
ele
=
dictGetEntryVal
(
de
);
elesize
=
(
ele
->
encoding
==
REDIS_ENCODING_RAW
)
?
(
sizeof
(
*
o
)
+
sdslen
(
ele
->
ptr
))
:
sizeof
(
*
o
);
asize
+=
(
sizeof
(
struct
dictEntry
)
+
elesize
)
*
dictSize
(
d
);
}
}
break
;
}
return
(
double
)
age
*
log
(
1
+
asize
);
}
...
...
@@ -8720,13 +8752,18 @@ static void *IOThreadEntryPoint(void *arg) {
static
void
spawnIOThread
(
void
)
{
pthread_t
thread
;
sigset_t
mask
,
omask
;
int
err
;
sigemptyset
(
&
mask
);
sigaddset
(
&
mask
,
SIGCHLD
);
sigaddset
(
&
mask
,
SIGHUP
);
sigaddset
(
&
mask
,
SIGPIPE
);
pthread_sigmask
(
SIG_SETMASK
,
&
mask
,
&
omask
);
pthread_create
(
&
thread
,
&
server
.
io_threads_attr
,
IOThreadEntryPoint
,
NULL
);
while
((
err
=
pthread_create
(
&
thread
,
&
server
.
io_threads_attr
,
IOThreadEntryPoint
,
NULL
))
!=
0
)
{
redisLog
(
REDIS_WARNING
,
"Unable to spawn an I/O thread: %s"
,
strerror
(
err
));
usleep
(
1000000
);
}
pthread_sigmask
(
SIG_SETMASK
,
&
omask
,
NULL
);
server
.
io_active_threads
++
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录