vTaskNotifyGiveFromISR() called not from an ISR

some basic questions:
is vTaskNotifyGiveFromISR() faster than vTaskNotifyGive() ?

Can I call vTaskNotifyGiveFromISR() from outside an interrupt or are there other risks and should use vTaskNotifyGive()?

I assume I can wake the same task from multiple points in the code using vTaskNotifyGiveFromISR() in one part of the code and vTaskNotifyGive() in another. Correct?

Thank you:)

There is a reason that there are 2 dedicated functions. I’d use them as documented.
Or which bigger problem do you want to solve ?

Yes, I was going to use them as suggested/designed to be used. I was just wondering whether the ISR one was faster.

The main question is whether I can wake the same task put in wait state by vTaskNotifyTake() form multiple vTaskNotifyGive() and vTaskNotifyGiveFromISR(). Which from what I have been reading seems to be the case but in a couple of forums it was confusing. Hence my question.

Thank you :slight_smile:

Yes - you can invoke vTaskNotifyGive(FromISR) from multiple tasks/ISRs.
The difference of the FromISR variants is that they internally take care about being called in ISR context which is different to a task context. It’s completely unrelated to execution speed.

In general, the FromISR versions are faster because there is less logic in them. See https://www.freertos.org/FAQ_API.html#IQRAPI - although that is less true for the TaskNotify()/TaskNotifyFromISR functions as they do not have lists of tasks waiting to send or waiting to receive so there is less logic in them anyway.

If the port you are using supports interrupt nesting (such as the Cortex-M, RX, PIC32, etc. ports do), then it is safe to call the FromISR functions from a task. If the port doesn’t support interrupt nesting then it is not safe because portSET_INTERRUPT_MASK_FROM_ISR() and portCLEAR_INTERRUPT_MASK_FROM_ISR() are not implemented so you do not have thread safey.

Thank you both for the clarification.