axos88 wrote on Wednesday, January 26, 2011:
I know this is a long dead thread, but I’ll give my two cents anyways (referring to msg https://sourceforge.net/projects/freertos/forums/forum/382005/topic/2284508?message=5322393 )
As you said hmm.
But this loop would happen only when one of the events in the event flag occurs, not everytime there is a task switch, so it would not impact system responsiveness in general, it would slow down only the event mechanism. And usually there aren’t so many tasks waiting for the same event list, maybe 3 or 4 at a time.
However there is another definition of the event flags (and easier to implement) would be this:
There are no combination of evetns, and they do not actually hold any value (set or unset). But at any time the event “occurs”, all tasks waiting for it unblock.
for example let the event be the arrival of a CAN Message.
Usually this message should be processed by only one thread, but sometimes more than one thread needs it. So in most cases only 1 thread is waiting on this event, but sometimes both.
When the Interrupt occurs, and the event is given a “push”, the threads waiting for it unblock, and first the one with the higher priority runs, and after that the one with lower priority.
I Don’t think it would be very complex to implement, you actually need a list of the tasks waiting for the specific event. When a thread starts waiting it is put into blocked state and when the event is given a push, it is unblocked and put in runnable state.
Is there any possibility for this to be implemented and integrated into FreeRTOS?