about Ready Task lists
Posted by Nobody/Anonymous on July 2, 2005
could anyone tell me why we use several pxReadyTasksLists which are created for each priority instead of using a single pxReadyTasksList for all priroities.
RE: about Ready Task lists
Posted by Richard
on July 2, 2005
It is done for speed and determinism - at the cost of RAM.
Maintaining a single queue of tasks in priority order would use less RAM, but inserting a task into a sorted queue within the RTOS tick would require searching the queue to find the correct position which is slow and non deterministic.
Maintaining a queue for each priority means the queues do not need to be sorted into priority order. Adding and removing tasks to the front and back of queues is quick and deterministic.
Bit of a rushed answer as Im short of time at the moment but hopefully ok?
Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd..
See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.