split into fifo and waiting_queue: sleep if nothing to do