Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Allow RTOS CPU yielding #8

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Commits on Mar 30, 2023

  1. Feature: Allow RTOS CPU yielding

    The biggest advantage of using a RTOS (FreeRTOS, Zephyr, …) is their
    ability to hide the complexity of asynchronous systems, but this often
    requires cooperation by the threads.
    
    This library makes extensive use of busy waiting when it is being used
    in blocking mode, which in the way it was implemented broke the
    cooperation principle. To solve this this patch introduces a function
    named `Mcb_RelinquishCPU` to `mcb_usr.h`.
    
    This function is executed on every iteration in the libraries busy
    waiting loops. When using an RTOS, the user can override it in order to
    execute their native thread yield / wait / … functions and allow the
    OS reschedule the task.
    
    On non RTOS systems this is of course a no-op.
    
    Signed-off-by: Elisabeth Friedrich <[email protected]>
    tyalie committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    eaa8d73 View commit details
    Browse the repository at this point in the history