在Linux内核中,线程调度是实时调度(如SCHED_FIFO)和普通调度(SCHED_NORMAL)。
如果我想创建一个实时线程,如何做到这一点?我想:
1,kthread_create 2、给线程一个实时调度程序。 3、指定实时优先级。
这对实时线程没问题吗?
发布于 2013-04-17 04:22:33
在线程本身中,调用:
struct sched_param param = { .sched_priority = prio };
sched_setscheduler(current, SCHED_FIFO, ¶m);其中prio是您想要的优先事项。
https://stackoverflow.com/questions/16042123
复制相似问题