In several software applications, especially in embedded application, the operating system is required to support the application to meet the timing constraints. The operating system achieves this by deploying suitable scheduling algorithms. A major problem arises, when the real-time tasks share resources. Priority inversions can take place in this case, unless suitable techniques are deployed. Starting with a brief introduction to real-time operating systems, we first discuss the important real-time task/thread scheduling algorithms and resource sharing protocols. An effort towards standardization of real-time operating systems has come to be known as POSIX-RT. We review POSIX-RT requirements. Besides, we review several commercial and open source real-time operating systems.