FIFO scheduling implementation

Hello. I wanted to implement FIFO scheduler in freeRTOS. I don’t know where and how to start. Is there any documentation about implementing FIFO or changing the scheduler in general?
Thanks.

What exactly do you miss ? There is a good an detailed documentation of FreeRTOS including

describing scheduling aspects.

1 Like

You are welcome to modify taskSELECT_HIGHEST_PRIORITY_TASK in tasks.c to whatever you wish.

1 Like

How about arrival time?
I checked the task.h for arrive or time keyword but seems I need to add it in order to implement FIFO?

If you refer to POSIX SCHED_FIFO scheduling scheme I think FreeRTOS can simply be configured that way.
Set configUSE_PREEMPTION to 1 and configUSE_TIME_SLICING to 0 and there is also a taskYIELD() function.
See also

As a side note, FreeRTOS already schedules tasks FIFO but with respect to their respective task priority levels, and to my best knowledge, there is no recording of arrival time stamps (no need because the queue management “insert to end” to “remove from front” semantics imply FIFO already).

If you need unconditional FIFO scheduling, simply set all tasks to the same priority, and you are there.

If you want to experiment with more sophisticated algorithms such as anticipated shortest job first, you’ll need to do the time stamp management yourself. Study tasks.c and make the necessary modifications.

Hello.
Are you sure there is USE_TIME_SLICING in config?
I have downloaded freeRTOS from pmvanker and there is no such attribute there.

Just click on link I’ve posted before… and you‘’ll be there.
As documented it’s enabled by default if not set/disabled in your FreeRTOSConfig.h.

1 Like