# portYIELD macro

**URL:** <https://forums.freertos.org/t/portyield-macro/13305>\
**Category:** Kernel\
**Created:** [August 24, 2021, 6:22am UTC](https://forums.freertos.org/t/portyield-macro/13305 "2021-08-24T06:22:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lsz13](https://avatars.discourse-cdn.com/v4/letter/l/3da27b/32.png) [@lsz13](https://forums.freertos.org/u/lsz13)\
**Post date:** [August 24, 2021, 6:22am UTC](https://forums.freertos.org/t/portyield-macro/13305/1 "2021-08-24T06:22:54Z")

</div>

Hello,  
Where I can find documentation or some explanation about portYIELD macro?

thanks.

---

<div class="post-metadata">

**Author:** ![hs2](https://avatars.discourse-cdn.com/v4/letter/h/a4c791/32.png) [@hs2](https://forums.freertos.org/u/hs2)\
**Post date:** [August 24, 2021, 7:11am UTC](https://forums.freertos.org/t/portyield-macro/13305/2 "2021-08-24T07:11:47Z")

</div>

In the docs [FreeRTOS - Task Control Functions and Macros for the Free Open Source RTOS FreeRTOS](https://www.freertos.org/a00020.html#taskYIELD)  
or search the forum  
[portYIELD() in preemptive mode - #2 by system](https://forums.freertos.org/t/portyield-in-preemptive-mode/1593/2)

> portYIELD() forces a context switch, but if the task calling yield is the highest priority task in the system it will run again immediately as you have not asked it to block, therefore the idle task will never execute. Try using vTaskDelay(1) instead. This will block the calling task until the next tick.

and/or lookup the FreeRTOS sources or just ask 🙂
