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

feat(main): 引入多线程读取 ctl 命名管道,用信号机制改写 service 和 task 的状态检查 #47

Merged
merged 6 commits into from
Nov 26, 2024

Conversation

val213
Copy link
Contributor

@val213 val213 commented Nov 1, 2024

需求:#46

原本当前主线的 test_ebpf 结果(55e6f0b65f91b32638fd56581f711a816eccdcd1):
5ddb62be75b613c972f8d9590920a4e
本分支修改后的 test_ebpf 结果
该分支的 test_ebpf 输出
注释掉 dragonreach 主进程下 loop 内容后,当前主线下 test_ebpf 结果
21703189a0904cb916abe0b2357c187

@val213 val213 changed the title feat: 引入多线程读取 ctl 命名管道,用信号机制改写 service 和 task 的状态检查 feat(main): 引入多线程读取 ctl 命名管道,用信号机制改写 service 和 task 的状态检查 Nov 1, 2024
@fslongjin fslongjin requested a review from GnoCiYeH November 12, 2024 13:00
Comment on lines 84 to 85
if SIGCHILD_SIGNAL_RECEIVED.load(Ordering::SeqCst) {
SIGCHILD_SIGNAL_RECEIVED.store(false, Ordering::SeqCst);
Copy link
Member

@fslongjin fslongjin Nov 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里用compare and exchange才对。否则可能有并发安全问题

if SIGCHILD_SIGNAL_RECEIVED.compare_exchange(true, false, Ordering::SeqCst, Ordering::SeqCst) {
.........
}

@fslongjin fslongjin merged commit 32c2329 into DragonOS-Community:master Nov 26, 2024
3 checks passed
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.

2 participants