vxworks任务调度学习.docVIP

  • 5
  • 0
  • 约4.93千字
  • 约 8页
  • 2016-01-08 发布于安徽
  • 举报
时间片轮转调度 我们来看一个具体的例子,在这个程序中,用户启动了三个优先级相同的任务,并通过对kernelTimeSlice(TIMESLICE)的调用启动了时间片轮转调度。 例1:时间片轮转调度 /* includes */ #include vxWorks.h #include taskLib.h #include kernelLib.h #include sysLib.h #include stdio.h /* function prototypes */ void taskOne(void); void taskTwo(void); void taskThree(void); /* globals */ ? #define ITER1 100 ? #define ITER2 10 ? #define PRIORITY 101 ? #define TIMESLICE sysClkRateGet() ? #define LONG_TIME 0xFFFFFFL void sched(void) /* function to create the three tasks */ ? { ? ? int taskIdOne, taskIdTwo, taskIdThree; ? ? if (kernelTimeSlice(TIMESLICE)

文档评论(0)

1亿VIP精品文档

相关文档