In this paper we present a real-time optimal control scheme of a Pendubot based on nonlinear model predictive control (NMPC) combined with nonlinear moving horizon estimation (NMHE). For the control of this fast, under-actuated nonlinear mechatronic system we utilize the ACADO Code Generation tool to obtain a highly efficient Gauss-Newton real-time iteration algorithm tailored for solving the underlying nonlinear optimization problems. To further improve the solvers' performance, we aim to parallelize particular algorithmic tasks within the estimation-control scheme. The overall control performance is experimentally verified by steering the Pendubot into its top unstable equilibrium. We also provide a computational efficiency analysis addressing different hardware/software configurations.