[riot-notifications] [RIOT-OS/RIOT] sys/sched_rr: Add a round robin scheduler module (#16126)

Karl Fessel notifications at github.com
Thu Apr 8 12:23:32 CEST 2021


@kfessel commented on this pull request.



> +}
+
+/**
+ * @brief   count the number of threads in a runqueue up to 2
+ *
+ * @param[in]   prio      the priority of the runqueue to get the length from
+ * @returns     number of threads in a runqueue up to 2
+ * @retval 0    The runqueue is empty
+ * @retval 1    There is exactly one thread in the runqueue
+ * @retval 2    There are at least two threads in the runqueue
+ *
+ * @warning This API is not intended for out of tree users.
+ *          Breaking API changes will be done without notice and
+ *          without deprecation. Consider yourself warned!
+ */
+static inline uint_fast8_t sched_runqueue_len2(uint8_t prio)

this thing is threre to avoid the O(n) complexity by limiting n thus making its formal complexity O(1)

i will check if "count upto n"  is optimized the same way.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16126#discussion_r609546634
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210408/e323da3f/attachment.htm>


More information about the notifications mailing list