ROS2 uses DDS, in the wiki it says that DDS is "The Data Distribution Service (DDS) for real-time systems is an Object Management Group (OMG) machine-to-machine (sometimes called middleware or connectivity framework)"
The question is, how can a real-time system run within a general-purpose operating system (like ubuntu, windows, etc)? a real-time system is supposed to be predictable and to ensure that it should communicate directly with the hardware (i.e. hardware timers) instead of being handled, for example, with ubuntu