generalize usage of the FIFO message queue to avoid deadlocks