Should I use RTOS Task Notifications when there are multiple writers to the same task?

Hi all,

I am getting myself familiar with the Task Notification feature.

In my project I have a “main” task which receives events (simple single 32-bit values) from several other tasks or ISRs. I was thinking of using xTaskNotifyWait in this “main” task to wait for events from the other tasks or ISRs (they would use xTaskNotify or xTaskNotifyFromISR to pass the 32bit value to “main”).

My concern is that if taskB sends a notification to “main” task, and before “main” can handle it, an ISR pops up and tries sending a notification to “main” as well. What would happen?

Is it better to use a message queue in my case, where all tasks/ISRs send their events to the same queue, and “main” task would block on it?

Thanks for your help!

your use case is a poster case for queues, not notifications.