The literature on thrust allocation algorithms that is currently available usually focuses on solving only a few of the many facets of the thrust allocation problem at a time. This paper presents a unified thrust allocation algorithm that solves most of the challenges that are faced by the practitioners in one algorithm. This includes controlling thrusters that can change the direction of the generated thrust slowly and/or reverse the direction of the generated thrust, minimizing the power consumption and wear-and-tear in the thrusters, and handling thruster saturations. When rotable thrusters are present, a functionality to avoid driving the thruster system into singular configurations should normally be included. This functionality requires significant numerical calculations for each iteration of the thrust allocation algorithm. In the presented work those calculations were written in explicit form using a symbolic processor, translated to ANSI C and compiled. This technique was demonstrated to provide acceptable real-time performance.