In a virtualized radio access network (RAN), baseband processing is performed by software running in cloud-computing platforms. However, current protocol stacks were not designed to run in this kind of environment, the high variability on the computational resources consumed by RAN functions may lead to eventual computational outages (where frames are not decoded on time), severely degrading the resulting performance. In this paper, we address this issue by re-designing two key functions of the protocol stack: 1) scheduling, to select the transmission of those frames that do not result in computational outages, and 2) modulation and coding scheme (MCS) selection, to downgrade the selected MCS in case no sufficient computational resources are available. We formulate the resulting problem as a joint optimization and compute the (asymptotically) optimal solution to this problem. We further show that this solution involves solving an NP-hard problem, and propose an algorithm to obtain an approximate solution that is computationally efficient while providing bounded performance over the optimal. We thoroughly evaluate the proposed approach via simulation, showing that it can provide savings as high as 80% of the computational resources while paying a small price in performance.