Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wushizhenking
CS-Notes
提交
137710c6
C
CS-Notes
项目概览
wushizhenking
/
CS-Notes
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
CS-Notes
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
137710c6
编写于
9月 03, 2018
作者:
C
CyC2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
auto commit
上级
64b26639
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
22 deletion
+13
-22
notes/CyC 学习交流群 问题汇总.md
notes/CyC 学习交流群 问题汇总.md
+0
-16
notes/消息队列.md
notes/消息队列.md
+1
-1
notes/缓存.md
notes/缓存.md
+12
-5
未找到文件。
notes/CyC 学习交流群 问题汇总.md
已删除
100644 → 0
浏览文件 @
64b26639
<!-- GFM-TOC -->
*
[
0. 进程内存空间中,堆和栈的区别
](
#0-进程内存空间中,堆和栈的区别
)
<!-- GFM-TOC -->
# 0. 进程内存空间中,堆和栈的区别
> C++
堆:动态、malloc()、new、链式分配、向上生长;栈:函数调用、编译器分配回收、向下生长。
https://www.cnblogs.com/sunziying/p/6510030.html
By @CyC
---
notes/消息队列.md
浏览文件 @
137710c6
...
...
@@ -70,7 +70,7 @@
接收端能够从消息队列成功消费一次消息。
实现方法:
两种
实现方法:
-
保证接收端处理消息的业务逻辑具有幂等性:只要具有幂等性,那么消费多少次消息,最后处理的结果都是一样的。
-
保证消息具有唯一编号,并使用一张日志表来记录已经消费的消息编号。
...
...
notes/缓存.md
浏览文件 @
137710c6
...
...
@@ -58,6 +58,7 @@ public class LRU<K, V> implements Iterable<K> {
}
}
public
LRU
(
int
maxSize
)
{
this
.
maxSize
=
maxSize
;
...
...
@@ -70,6 +71,7 @@ public class LRU<K, V> implements Iterable<K> {
tail
.
pre
=
head
;
}
public
V
get
(
K
key
)
{
if
(!
map
.
containsKey
(
key
))
{
...
...
@@ -83,6 +85,7 @@ public class LRU<K, V> implements Iterable<K> {
return
node
.
v
;
}
public
void
put
(
K
key
,
V
value
)
{
if
(
map
.
containsKey
(
key
))
{
...
...
@@ -100,30 +103,34 @@ public class LRU<K, V> implements Iterable<K> {
}
}
private
void
unlink
(
Node
node
)
{
Node
pre
=
node
.
pre
;
node
.
pre
=
node
.
next
;
node
.
next
=
pre
;
Node
next
=
node
.
next
;
pre
.
next
=
next
;
next
.
pre
=
pre
;
}
private
void
appendHead
(
Node
node
)
{
node
.
next
=
head
.
next
;
node
.
pre
=
head
;
head
.
next
=
node
;
}
private
Node
removeTail
()
{
Node
node
=
tail
.
pre
;
node
.
pre
=
tail
;
tail
.
pre
=
node
.
pre
;
return
node
;
}
@Override
public
Iterator
<
K
>
iterator
()
{
return
new
Iterator
<
K
>()
{
private
Node
cur
=
head
.
next
;
@Override
public
boolean
hasNext
()
{
return
cur
!=
tail
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录