could anyone tell me why we use several pxReadyTasksLists which are created for each priority instead of using a single pxReadyTasksList for all priroities.
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? Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.