Nucleus OS

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
What does generally happen in such a scenario? FWIW I'm using Nucleus.

Suppose there are two Task in our System A & B.
A has a higher priority than B and both are preemptable.

A is waiting for an Event while B is executing in
function()
{
    while (1)
    {
        /* Do Something */
    }
}

1. Can A preempt B in middle of a function call? If it can ...
2. When A gets the event, B moves to suspended state or ready queue?
3. If it is moved to suspended state then how does it start to execute
once A is has suspended
4. If it is moved to ready queue, then it's state is READY? So it
means that tasks can go from RUNNING to READY in Nucleus?

Thanks


Re: Nucleus OS
Quoted text here. Click to load it

I am not familiar with Nucleus but will provide a generic answer...


Quoted text here. Click to load it


As you say, the tasks are preemptable, so yes.


Quoted text here. Click to load it


Ready.  It is still able to run.  It just cannot run while a higher priority
task is running.


Quoted text here. Click to load it

That is what the scheduler is for.  The task does not need to know about it,
the scheduler will start it when it is the highest priority task that is
available to execute.


Quoted text here. Click to load it


Yes - as in most if not all systems.

You need to know these basics before you can use Nucleus to design a system.

--
Regards,
Richard.

We've slightly trimmed the long signature. Click to see the full one.

Site Timeline