gpt4 book ai didi

c - sched.h 中 thread_group 列表的元素类型是什么?

转载 作者:太空宇宙 更新时间:2023-11-04 10:23:07 25 4
gpt4 key购买 nike

sched.h ,task_struct 有以下 2 个字段:thread_group 和 thread_node。他们保留了列表的第一个元素,但我找不到它们包含哪种类型的变量。

1511 struct task_struct {
....
1657 /* PID/PID hash table linkage. */
1658 struct pid_link pids[PIDTYPE_MAX];
1659 struct list_head thread_group;
1660 struct list_head thread_node;
....
}

最佳答案

thread_groupthread_node 都是线程组中所有线程的侵入式链表 - 它们用于将 task_struct 链接在一起,它们不“包含”任何东西。

两者的区别在于thread_group的头部位于线程组组长的task_struct中,而thread_node的头部位于线程组共享的signal_struct。中期 thread_group 将消失。

关于c - sched.h 中 thread_group 列表的元素类型是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42990061/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com