Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
e6668071
提交
e6668071
11月 14, 2011
创建
作者:
Silas Boyd-Wickizer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Some comments about wq.c
上级
a2c48700
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
32 行增加
和
0 行删除
+32
-0
wq.c
wq.c
+32
-0
没有找到文件。
wq.c
浏览文件 @
e6668071
// cilk style run queue
// A work queue is built from NCPU per-core wqueues.
// A core pushes work to the head of its per-core wqueue.
// A core pops work from the head of its per-core wqueue.
// A core pops work from the tail of another core's per-core wqueue.
//
// Usage:
// void goo(uptr a0, uptr a1) {
// char *arg = (char*) a0;
// cprintf("goo\n");
// arg[1] = 'g';
// }
// void foo(uptr a0, uptr a1) {
// char *arg = (char*) a0;
// wq_push(goo, a0, 0);
// arg[0] = 'f';
// cprintf("foo\n");
// }
// void example(void) {
// char arg[2];
// wq_start();
// wq_push(foo, (uptr)arg, 0);
// cprintf("example\n");
// wq_end();
// cprintf("%c %c\n", arg[0], arg[1]);
// }
#if WQENABLE
#include "types.h"
#include "kernel.h"
...
...
@@ -181,6 +208,8 @@ wq_trywork(void)
return
0
;
}
// Start a new work queue frame.
// We don't allow nested work queue frames.
void
wq_start
(
void
)
{
...
...
@@ -189,6 +218,9 @@ wq_start(void)
panic
(
"wq_start"
);
}
// End of the current work queue frame.
// The core works while the reference count of the current
// work queue frame is not 0.
void
wq_end
(
void
)
{
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论