We consider a single server first-come-first-served queue with a stationary and ergodic input. The service rate is a general function of the workload in the queue. We provide the necessary and sufficient conditions for the stability of the system and the asymptotic convergence of the workload process to a finite stationary process at large times. Then, we consider acyclic networks of queues in which the service rate of any queue is a function of the workloads of this and of all the preceding queues. The stability problem is again studied. The results are then extended to analogous systems with periodic inputs.