Converted from using a message queue for the raw input queue to using a ring buffer in conjunction with a counting semaphore.