[riot-devel] thread_yeild

Somaraju Abhinav abhinav.somaraju at tridonic.com
Mon Sep 1 11:48:10 CEST 2014


Thanks Thomas - This is what I was hoping to hear!
Regards,
Abhinav

-----Original Message-----
From: devel [mailto:devel-bounces at riot-os.org] On Behalf Of Thomas
Eichinger
Sent: Montag, 01. September 2014 11:46
To: RIOT OS kernel developers
Subject: Re: [riot-devel] thread_yeild

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
_______________________________________________
devel mailing list
devel at riot-os.org
http://lists.riot-os.org/mailman/listinfo/devel
________________________________________________________
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.



More information about the devel mailing list