— Ergodic stochastic optimization (ESO) algorithms are proposed to solve resource allocation problems that involve a random state and where optimality criteria are expressed in terms of long term averages. A policy that observes the state and decides on a resource allocation is proposed and shown to almost surely satisfy problem constraints and optimality criteria. Salient features of ESO algorithms are that they do not require access to the state’s probability distribution, that they can handle non-convex constraints in the resource allocation variables, and that convergence to optimal operating points holds almost surely. The proposed algorithm is applied to determine operating points of an orthogonal frequency division multiplexing broadcast channel that maximize a given rate utility.