Use two threads, one to read commands, and one to process them