Resource allocation in wireless networks with flow level dynamics