# FreeRTOS SMP: portYIELD\_CORE(x)

**URL:** <https://forums.freertos.org/t/freertos-smp-portyield-core-x/22841>\
**Category:** Kernel\
**Tags:** smp\
**Created:** [April 3, 2025, 10:34am UTC](https://forums.freertos.org/t/freertos-smp-portyield-core-x/22841 "2025-04-03T10:34:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matth9814](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/matth9814/32/5174_2.png) [@Matth9814](https://forums.freertos.org/u/Matth9814)\
**Post date:** [April 3, 2025, 10:34am UTC](https://forums.freertos.org/t/freertos-smp-portyield-core-x/22841/1 "2025-04-03T10:34:49Z")

</div>

Hi, I am done implementing the portYIELD\_CORE(x) macro but I don’t completely get how it should be used. The inter-core signaling is currently implemented with a software generated interrupt so I need to install an handler on the cores that can receive this kind of interrupt. At this point my questions are:

1. Is it possible for a core to use portYIELD\_CORE(x) on itself?
2. Can secondary cores (i.e. cores that do not handle the SysTick interrupt) use portYIELD\_CORE(x)?

Thanks

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [April 3, 2025, 11:43am UTC](https://forums.freertos.org/t/freertos-smp-portyield-core-x/22841/2 "2025-04-03T11:43:46Z")

</div>

> [@Matth9814](#):
>
> Is it possible for a core to use portYIELD\_CORE(x) on itself?

No, it is used only to signal other core.

> [@Matth9814](#):
>
> Can secondary cores (i.e. cores that do not handle the SysTick interrupt) use portYIELD\_CORE(x)?

Yes, they can.

---

<div class="post-metadata">

**Author:** ![Matth9814](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/matth9814/32/5174_2.png) [@Matth9814](https://forums.freertos.org/u/Matth9814)\
**Post date:** [April 3, 2025, 11:48am UTC](https://forums.freertos.org/t/freertos-smp-portyield-core-x/22841/3 "2025-04-03T11:48:45Z")

</div>

Ok, thank you. So even the primary core should be able to handle it, right?

---

<div class="post-metadata">

**Author:** ![richard-damon](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/richard-damon/32/38_2.png) [@richard-damon](https://forums.freertos.org/u/richard-damon)\
**Post date:** [April 3, 2025, 1:11pm UTC](https://forums.freertos.org/t/freertos-smp-portyield-core-x/22841/4 "2025-04-03T13:11:10Z")

</div>

Yes, because a “secondary” core can unblock a task with a higher priority then the primary core is currently running, but below the priority of the task it is running, so the primary core should switch tasks.

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [April 3, 2025, 2:15pm UTC](https://forums.freertos.org/t/freertos-smp-portyield-core-x/22841/5 "2025-04-03T14:15:30Z")

</div>

> [@Matth9814](#):
>
> So even the primary core should be able to handle it, right?

Can you help me understand why you mean by “it” here?

---

<div class="post-metadata">

**Author:** ![Matth9814](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/matth9814/32/5174_2.png) [@Matth9814](https://forums.freertos.org/u/Matth9814)\
**Post date:** [April 3, 2025, 2:49pm UTC](https://forums.freertos.org/t/freertos-smp-portyield-core-x/22841/6 "2025-04-03T14:49:18Z")

</div>

Yes, sorry, “it” means “the interrupt directed from the core that executes portYIELD\_CORE(x) to core x”.

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [April 3, 2025, 4:23pm UTC](https://forums.freertos.org/t/freertos-smp-portyield-core-x/22841/7 "2025-04-03T16:23:51Z")

</div>

Yes, then you are right and @richard-damon already explained the reasoning.
