2565
- 收藏
- 点赞
- 分享
- 举报
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. 内容
- 缩进内容
- 图片
相关问答
-
2019-01-02 09:00:52
-
2018-11-09 09:22:55
-
02019-01-02 11:00:58
-
2019-02-15 13:54:54
-
2020-11-30 09:24:35
-
2018-12-18 16:49:00
-
2019-01-14 14:10:29
-
32020-11-25 16:17:41
-
2017-06-29 14:30:34
-
2018-12-24 17:11:14
-
2020-11-25 13:57:09
-
2020-11-25 13:12:09
-
2018-12-13 09:13:31
-
2019-01-22 16:26:26
-
2019-01-03 15:07:45
-
2018-12-03 15:06:34
-
2017-02-28 11:24:46
-
2018-12-27 09:15:03
-
2018-12-19 13:49:10
无更多相似问答 去提问
点击登录
-- 积分
-- E币
提问
—
收益
—
被采纳
—
我要提问
切换马甲
上一页
下一页
悬赏问答
-
10T32crop和fcrop怎么从中间裁剪?
-
53516卡死问题
-
10hi3516cv610 去除风扇声音,人说话声音正常输出不变声
-
5hi3516cv610适配imx662的wdr模式出图图像不正常怎么去解决
-
5ss928 [sample_comm_venc_get_venc_stream_proc]-2627: get venc stream time out, exit thread
-
10要一份RK3576最新硬件资料包
-
5海思DPU的查找表怎么获取
-
10海思Hi3519DV500 自动对焦算法求助
-
10鸿欧派 Hi3519Dv500
-
10【求助】RK3576实现推流和GC2053摄像头颜色偏绿
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
提醒
你的问题还没有最佳答案,是否结题,结题后将扣除20%的悬赏金
取消
确认
提醒
你的问题还没有最佳答案,是否结题,结题后将根据回答情况扣除相应悬赏金(1回答=1E币)
取消
确认

微信扫码分享
QQ好友