Real Time additions in a non Real-Time scheduling algorithm..

Real-Time Additions in a Non-Real-Time Scheduling Algorithm

Introduction

After thinking about how to integrate real-time processes such as multimedia, graphics, and network tasks into my scheduling system, I realized that instead of trying to mix apples and oranges, I could actually run them on a dedicated core – a specialized real-time core.

How Does It Work?

Instead of making every core busy with real-time processes (which would slow down the system), we can reserve one or two cores for these tasks. This is done by introducing a system call entry that allows a core to switch between different roles:

  • Unavailable Core
  • Normal Core
  • Boot Core
  • Real-Time Core (New Addition)

Since the scheduler was already portable, these changes were relatively straightforward to integrate.

Simplified Algorithm

Here’s a simplified version of the logic behind assigning real-time tasks to a dedicated core:

if (HW_Thread_Available) {
    check_affinity();
    
    if (Real_Time) {
        switch_to_real_time_core();
    } else {
        continue_to_next_core();
    }
    
    if (!correct_affinity) {
        if (Real_Time) {
            find_fallback_real_time_core();
        } else {
            if (!Invalid_Core && !Boot_Core) {
                try_switching_to_core();
                
                if (switch_fails) {
                    search_for_alternative_core();
                }
            }
        }
    }
}

Conclusion

By reserving dedicated cores for real-time processing, we can prevent unnecessary slowdowns while maintaining a responsive system.

📢 I will likely make these additions publicly available! If you’re interested, follow & star my project OpenNE on GitHub! 🚀