What are level in the thread?

Richi Dubey richidubey at gmail.com
Fri Dec 11 07:22:21 UTC 2020


Dear Dr. Sherrill,

Thank you for your answer. Your explanation has been helpful.

It would seem that we need a discussion of the types of critical sections,
> when they are used, and the difference between uniprocessor and symmetric
> processing configurations.

It'd be really helpful if someone can write about this in the
documentation.


This is a critical section which prevents thread context switches from
> occurring while the dispatch level is not zero. This is generally used so
> dispatching is deferred until the end of operations. It is also used so we
> do not attempt to switch to another thread while in the middle of an
> interrupt service routine

 Okay, so this is for the dispatch disable level, what about pin level? Is
it like a boolean value in some way, true for level 1 and false for 0?


On Sat, Dec 5, 2020 at 10:20 PM Joel Sherrill <joel at rtems.org> wrote:

>
>
> On Sat, Dec 5, 2020, 12:15 AM Richi Dubey <richidubey at gmail.com> wrote:
>
>> I tried searching it on Google and RTEMS Documentation, but couldn't find
>> anything that explains this.
>>
>> On Sat, Dec 5, 2020 at 11:34 AM Richi Dubey <richidubey at gmail.com> wrote:
>>
>>> Hi,
>>>
>>> Can someone please help me understand what is meant by level? What is
>>> meant by the dispatch level and the pin level and other such definitions? I
>>> just want a high-level idea of what we achieve by having levels and why we
>>> need them.
>>>
>>
> This is a critical section which prevents thread context switches from
> occurring while the dispatch level is not zero. This is generally used so
> dispatching is deferred until the end of operations. It is also used so we
> do not attempt to switch to another thread while in the middle of an
> interrupt service routine
>
> I would think this was documented somewhere but honestly I don't know
> where.  If someone has a suggestion , then we should add it.
>
> It would seem that we need a discussion of the types of critical sections,
> when they are used, and the difference between uniprocessor and symmetric
> processing configurations.
>
>>
>>> Why do we have:
>>>
>>>  _Assert( cpu_self->thread_dispatch_disable_level == 1 );
>>>
>>> in some codes?
>>>
>>
> This means that the software should not be called when dispatching is
> disabled. This may mean not from an interrupt service routine although that
> is by implication since you could have checked the interrupt nest level.
> This can prevent some methods from being called from a user extension.
>
> --joel
>
>> _______________________________________________
>> devel mailing list
>> devel at rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20201211/30203594/attachment-0001.html>


More information about the devel mailing list