2124
- 收藏
- 点赞
- 分享
- 举报
calling task 什么意思?
VxWorks 5.4 Programmer's Guide
Chapter 2 Basic OS
Section 2.3.4 Tasking Control
Subject Task Names and IDs
Page 26
"Most VxWorks task routines take a task ID as the argument specifying
a task. VxWorks uses a convention that a task ID of 0 (zero) always
implies the calling task."
“绝大多数与任务相关的VxWorks例程使用“task ID”参数来指定某一任务。
按照惯例VxWorks,task ID为0总是用来指定调用任务。”
如:函数taskPriorityGet()
extern STATUS taskPriorityGet (int tid, int *pPriority);
假设有任务A、B、C,任务ID分别是0x10000、0x20000、0x30000,
对应的优先级分别是100、200、300,则
int tidOfTaskC = 0x30000;
void test_taskPriorityGet()
{
int pri;
taskPriorityGet (tidOfTaskC, &pri);
printtf("Priority of task C is %d.\n", pri);
taskPriorityGet (0, &pri);
printtf("Priority of the calling task is %d.\n", pri);
}
如果上面函数在任务A的上下文中执行,则会打印
Priority of task C is 300.
Priority of the calling task is 100.
如果上面函数在任务A的上下文中执行,则会打印
Priority of task C is 300.
Priority of the calling task is 200.
其实对于这个问题的理解关键是要注意在多任务环境中,同一个函数是有可能
被多个任务所调用的(在不同的上下文环境中执行),如:
void task_A_entry()
{
test_taskPriorityGet();
}
void task_B_entry()
{
test_taskPriorityGet();
}
task_A_entry、task_B_entry分别是任务A、B的入口函数。
Chapter 2 Basic OS
Section 2.3.4 Tasking Control
Subject Task Names and IDs
Page 26
"Most VxWorks task routines take a task ID as the argument specifying
a task. VxWorks uses a convention that a task ID of 0 (zero) always
implies the calling task."
“绝大多数与任务相关的VxWorks例程使用“task ID”参数来指定某一任务。
按照惯例VxWorks,task ID为0总是用来指定调用任务。”
如:函数taskPriorityGet()
extern STATUS taskPriorityGet (int tid, int *pPriority);
假设有任务A、B、C,任务ID分别是0x10000、0x20000、0x30000,
对应的优先级分别是100、200、300,则
int tidOfTaskC = 0x30000;
void test_taskPriorityGet()
{
int pri;
taskPriorityGet (tidOfTaskC, &pri);
printtf("Priority of task C is %d.\n", pri);
taskPriorityGet (0, &pri);
printtf("Priority of the calling task is %d.\n", pri);
}
如果上面函数在任务A的上下文中执行,则会打印
Priority of task C is 300.
Priority of the calling task is 100.
如果上面函数在任务A的上下文中执行,则会打印
Priority of task C is 300.
Priority of the calling task is 200.
其实对于这个问题的理解关键是要注意在多任务环境中,同一个函数是有可能
被多个任务所调用的(在不同的上下文环境中执行),如:
void task_A_entry()
{
test_taskPriorityGet();
}
void task_B_entry()
{
test_taskPriorityGet();
}
task_A_entry、task_B_entry分别是任务A、B的入口函数。
我来回答
回答0个
时间排序
认可量排序
暂无数据
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
相关问答
-
2019-01-02 09:00:52
-
2019-02-15 13:54:54
-
02019-01-02 11:00:58
-
2018-11-09 09:22:55
-
2020-11-30 09:24:35
-
2019-01-14 14:10:29
-
32020-11-25 16:17:41
-
2018-12-18 16:49:00
-
2020-11-25 13:12:09
-
2017-06-29 14:30:34
-
2018-12-13 09:13:31
-
2018-12-24 17:11:14
-
2020-11-25 13:57:09
-
2018-12-03 15:06:34
-
2019-01-22 16:26:26
-
2019-01-03 15:07:45
-
2019-01-02 14:21:02
-
2016-10-28 12:30:38
-
2018-12-19 13:49:10
无更多相似问答 去提问
点击登录
-- 积分
-- E币
提问
—
收益
—
被采纳
—
我要提问
切换马甲
上一页
下一页
悬赏问答
-
10海思IVP928
-
522AP10支持F35SQA001G spi nand flash
-
20如何将自有训练的RAW降噪模型应用于AIBNR?
-
10RV1106的低功耗和休眠唤醒功能
-
10海思平台(Hi3516DV500),设置完ldc参数后 工作异常
-
5rv1126-dc-201 安装hi3881.ko wifi驱动成功后 启动connmand服务,系统就崩了
-
10ss928编码的h264帧流,用RTSP传输到电脑,VLC播放不了是什么情况?
-
10我运行rv1126的开发环境后,编译demo提示没有opencv,自行编译安装后没有解决,请问这个怎么处理呢?板子是easy eai nano
-
50CPS-1848 link不上FPGA。
-
10想问一下各位大佬们,关于VI配置成8Lan LVDS模式的相关问题
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
提醒
你的问题还没有最佳答案,是否结题,结题后将扣除20%的悬赏金
取消
确认
提醒
你的问题还没有最佳答案,是否结题,结题后将根据回答情况扣除相应悬赏金(1回答=1E币)
取消
确认