what's the meaning of _Thread_Dispatch_disable_level?

Gedare Bloom gedare at rtems.org
Wed Nov 18 15:22:59 UTC 2015


I guess you are reading about porting RTEMS to different
architectures? The _Thread_Dispatch_disable_level is an internal RTEMS
variable that is used to prevent the kernel from switching to a new
thread. Usually it is checked during interrupt handling, which can
otherwise switch the executing thread when the ISR terminates.

On Wed, Nov 18, 2015 at 7:41 AM, Chan Kim <ckim at etri.re.kr> wrote:
>
> Hi, I was reading some codes and related document on porting but it's difficult to understand.
> This seems to be a basics but could somebody please tell me what the _Thread_Dispatch_disable_level means?
> From the function below, It seems incrementing that number disables thread dispatch.
>
> RTEMS_INLINE_ROUTINE void _Thread_Disable_dispatch( void )
> {
>   _Thread_Dispatch_increment_disable_level();
>   RTEMS_COMPILER_MEMORY_BARRIER();
> }
>
> What does it mean to 'dispatch a thread' here? and how is the value _Thread_Dispatch_disable_level used?
> (from the code following, I guess it's preventing preemption, but how is setting this value affects the scheduler? the scheduler _Scheduler_Tick() examins this value and doesn't switch task? I guess.. I know disabling interrupt is separate thing.)
> Thanks in advance.
> Chan
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users



More information about the users mailing list