[riot-devel] thread_yeild

Thomas Eichinger thomas.eichinger at fu-berlin.de
Mon Sep 1 11:45:33 CEST 2014


Dear Abhinav,

`thread_yield()` is used a lot in the periph drivers for i.e. stm32f*
CPUs in the following manner.

```C
...
if (sched_context_switch_request) {
    thread_yield()
}
```

This way the scheduler performs a thread change (if requested) then
the ISR is finished and returns from interrupt context into the newly
scheduled thread.

Hope this helps!

Best, Thomas

On 1 Sep 2014, at 11:25 CEST(+0200), Somaraju Abhinav wrote:

> Hello,
>
> if the thread_yeild function is called from within an ISR, then when
> does the program exit the ISR. Does the scheduler make sure that we exit
> the ISR before running the new thread or do we continue to be in the
> ISR?
>
>
>
> Thanks a lot for the help!
>
>
>
> Regards,
>
> Abhinav
>
> ________________________________________________________
> The contents of this e-mail and any attachments are confidential
> to the intended recipient. They may not be disclosed to or used
> by or copied in any way by anyone other than the intended recipient.
> If this e-mail is received in error, please immediately notify
> the sender and delete the e-mail and attached documents.
>
> Please note that neither the sender nor the sender's company
> accept any responsibility for viruses and it is your responsibility
> to scan or otherwise check this e-mail and any attachments.
> _______________________________________________
> devel mailing list
> devel at riot-os.org
> http://lists.riot-os.org/mailman/listinfo/devel


More information about the devel mailing list