Mainline or vanilla Linux (the kernel you download from https://kernel.org) is decidedly not a Real-Time Operating System (RTOS); it's a General Purpose Operating System (GPOS; as is Windows, macOS, Unix). In an RTOS, where hard real-time characteristics come into play, not only must the software obtain the correct result, there are deadlines associated with doing so; it must guarantee it meets these deadlines, every single time. The mainline Linux OS, though not an RTOS, does a tremendous job: it easily qualifies as being a soft real-time OS (one where deadlines are met most of the time). Nevertheless, true hard real-time domains (for example, military operations, many types of transport, robotics, telecom, factory floor automation, stock exchanges, medical electronics, and so on) require an RTOS.
Another key point in this context is that of determinism: an oft missed point regarding...