Real-time systems demand stringent adherence to timing constraints, making CPU scheduling a critical factor for ensuring timely and reliable task execution. Traditional CPU scheduling algorithms, while effective in many scenarios, often fall short in handling the dynamic and complex nature of modern real-time applications. This paper provides a comprehensive review and analysis of machine learning (ML) techniques employed to optimize CPU scheduling in real-time systems. We explore various ML methodologies including supervised learning, reinforcement learning, and deep learning, examining their applications, advantages, and limitations in the context of real-time CPU scheduling. By leveraging ML, these systems can dynamically adapt to changing workloads, predict task execution times, and optimize scheduling policies, thereby improving overall system performance and predictability. Key contributions of this review include a detailed comparison of ML-based approaches against traditional scheduling techniques, insights into their real-time applicability, and identification of future research directions. The analysis underscores the potential of ML to transform CPU scheduling by providing adaptive, intelligent solutions that cater to the evolving demands of real-time systems