Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update 1130 #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

update 1130 #1

wants to merge 2 commits into from

Conversation

qxlx
Copy link
Owner

@qxlx qxlx commented Nov 30, 2023

No description provided.

@qxlx
Copy link
Owner Author

qxlx commented Nov 30, 2023

1130 整理线程池部分,两道算法题

@qxlx
Copy link
Owner Author

qxlx commented Dec 1, 2023

linux top、vmstat、pidstat、jstat、jstack、jmap

@qxlx
Copy link
Owner Author

qxlx commented Dec 1, 2023

重复消费的场景
1.幂等的基本概念
2.producer幂等 ,pid,partion,seqnumb 会话幂等
幂等型Producer 可以保证回话级别的,但是重启失败就会丢失
事务性prodcer 可以保证跨会话跨分区。
3.consumer幂等
1.落记录判断 setnx 2.判断处理状态

@qxlx
Copy link
Owner Author

qxlx commented Dec 1, 2023

top
top -Hp pid 查看具体线程使用系统资源情况:
vmstat 上下文交换

@qxlx
Copy link
Owner Author

qxlx commented Dec 4, 2023

newFixedThreadPool 核心=最大,队列是无界的。所以当任务处理不过来的时候,会出现OOM
newSingleThreadExecutor 核心=最大=1 队列无界
newCachedThreadPool 一直new线程处理

@qxlx
Copy link
Owner Author

qxlx commented Dec 4, 2023

lsof -p pid | wc -l 查看进程打开的文件句柄数

@qxlx
Copy link
Owner Author

qxlx commented Dec 4, 2023

@qxlx
Copy link
Owner Author

qxlx commented Dec 5, 2023

runnable 和 callable的区别
1.runnable没有返回值 2.runnable不能thorw check exception
2.future 可以异步执行 get方法是阻塞的
isDone() 是否执行完毕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant