RTOS任务抢占和非抢占相关查询 [英] RTOS task preemption and non preemption related query

查看:136
本文介绍了RTOS任务抢占和非抢占相关查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个与RTOS相关的查询。我们正在使用Nucleus RTOS。但我的查询是Generic。假设一个任务正在执行,并且如果它的抢占被禁用,那么该任务是否具有原子性?我在这里要问的是,一旦任务的抢占被禁用,ISR例程中断可以中断任务吗?禁用任务的抢占意味着,所有其他任务都不能中断正在执行的特定任务。那么,在这种情况下ISR会导致中断吗?通过禁用抢占,是禁用ISR的含义aslo ??

Hi,

I have one query related to RTOS. We are using Nucleus RTOS. But my query is Generic. Suppose if a task is executing and if it's preemption is disabled, then is the task becoming atomic in nature? What i am asking here is, once the preemption of a task is disabled, can ISR routine interrupts interrupt the task? disabling the preemption of a task means, all other tasks cannot interrupt the particular task that is executing. so, can ISR in this situation can cause the interruption? and by disabling the preemption, is it a meaning of disabling the ISR aslo??

推荐答案

ISR和RTOS是两件事(ISR不依赖于RTOS但是RTOS可能依赖ISR,如Tick ISR)。禁用抢占并不意味着任何ISR都不会启动。例如,如果您已启用其他功能的中断,例如SPI或I2C,那么任何此类事件都可能会中断您的线程执行。
ISR and RTOS are two things (ISR does not rely on RTOS but RTOS may rely on ISRs, like the Tick ISR). Disabling pre-emption does not at all mean that any ISR will not kick in. If you have enabled interrupts for other features, like SPI or I2C, for example, then any of such events can interrupt your thread execution.


这篇关于RTOS任务抢占和非抢占相关查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆